-->
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: Optimistic locking
PostPosted: Tue Oct 26, 2004 4:08 pm 
Newbie

Joined: Tue Oct 26, 2004 1:35 pm
Posts: 3
Regarding the FAQ listed on page 171 of the book. Since adding a new bid for an Item updates the Item version number (ie. changes to the child collection make the parent dirty) am I correct in assuming that a StaleObjectStateException might be thrown if an item receives a bid while the Item details (say description) are being edited?

This assumes that one would use a detached Item for the editing process that would be stored in HttpSession while the Item between the request to edit the Item and the POST to apply the changes (presumably by the auction's creator, perhaps to correct a small typo in the Item description).

Thanks in advance,

Thomas


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 26, 2004 4:55 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Yes, correct. As you can see, this behavior is good in some situations but not good in others (e.g. when you don't want a particular one-to-many "link" modification make the "one" object dirty). Thats why this behavior can be defined for each association/property in Hibernate3.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 26, 2004 6:05 pm 
Newbie

Joined: Tue Oct 26, 2004 1:35 pm
Posts: 3
Fantastic. Thanks for the quick reply.


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.