-->
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: can't "upgrade" to LockMode.OPTIMISTIC
PostPosted: Mon Aug 16, 2010 4:19 pm 
Newbie

Joined: Thu Sep 11, 2008 4:24 pm
Posts: 4
Hibernate 3.5 has new LockModes, two related to optimistic locks, LockMode.OPTIMISTIC and LockMode.OPTIMISTIC_FORCE_INCREMENT. I'd like to use this lockmodes, to do a version check/upgrade on commit. But when an entity is loaded inside a transaction, its LockMode is set to READ, that has a greater level (See LockMode class). And hibernate does not "downgrade" a lock.

Hibernate manual tells that only on REPEATABLE_READ and SERIALIZABLE lockmode is set to READ, but my tests and hibernate code apparently does not... Is this a bug?

I can use this new LockModes evicting the entities, but this sound dirty and cause bad effects.

Has someone used this Lock Modes?

Thanks,


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.