-->
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.  [ 1 post ] 
Author Message
 Post subject: About other ways to implement optimistic locking
PostPosted: Wed Sep 20, 2006 3:39 pm 
Newbie

Joined: Wed Sep 20, 2006 2:10 pm
Posts: 1
As we know, Hibernate uses version or timestamp columns to implement optimistic locking mechanism which is the default one.

In book “Hibernate in Action”, it says
Quote:
If you don't have version or timestamp columns, Hibernate can still perform optimistic locking, but only for objects that are retrieved and modified in the same Session. If your need optimistic locking for detached objects, you must use a version number or timestamp.


I am confused here. For example, after I retrieve an object from database, the object’s state persistent. So optmistic locking should work here. If I call evict(), close(), or clear(), the object becomes detached. Can I still implement optimistic locking for this detached object which is persistent before?


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

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.