-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: NPE during update
PostPosted: Wed Jan 12, 2005 4:09 am 
Newbie

Joined: Wed Dec 22, 2004 5:56 am
Posts: 9
I tried to submit the bug that when i call update on object with null version property the NPE is thrown.

The bug was closed by Gavin King 'cause with explanation "You cannot call update() on an object with a null version property. By definition."

And I would like to ask, why for update it is not by definition permited and delete throws very nice PropertyValueException?? I thing that the exception thrown by Hibernate are very different method by method and especially flushing throws exceptions, that nobody known which object the problem caused (I like very much the one with message ending "row not found").

Thanks for answer.

Jirka


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 7:32 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
For the exception return, you should think of what happen if you update a delete object in a DB.

You cannot uddate an optimistic locked object if you don't provide the optimistc locking informations, otherwis you'd break the semantic.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 7:43 am 
Newbie

Joined: Wed Dec 22, 2004 5:56 am
Posts: 9
I dont't understand how your reply correlate to my question, why delete and update behave different?

I think that update and delete should behave the same way to updating and deleteing non-existed DB object (row).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.