-->
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: JPA LockmodeType and equvalent to Hibernate LockMode
PostPosted: Sat May 17, 2014 3:20 pm 
Newbie

Joined: Sat May 17, 2014 1:26 pm
Posts: 2
Please, could you confirm the equivalent JPA 2.0 lock modes are defined in the LockModeType and Hibernate LockMode:

- OPTIMISTIC (was READ in JPA 1.0) == LockMode.OPTIMISTIC
The Entity will have its optimistic lock version checked on commit, to ensure no other transaction updated the object.

- OPTIMISTIC_FORCE_INCREMENT (was WRITE in JPA 1.0) == LockMode.OPTIMISTIC_FORCE_INCREMENT
The Entity will have its optimistic lock version incremented on commit, to ensure no other transaction updated (or READ locked) the object.



- PESSIMISTIC_READ == LockMode.READ ???
The Entity is locked on the database, prevents any other transaction from acquiring a PESSIMISTIC_WRITE lock.

- PESSIMISTIC_WRITE == LockMode.PESSIMISTIC_WRITE;
The Entity is locked on the database, prevents any other transaction from acquiring a PESSIMISTIC_READ or PESSIMISTIC_WRITE lock.

- PESSIMISTIC_FORCE_INCREMENT == LockMode.PESSIMISTIC_FORCE_INCREMENT;
The Entity is locked on the database, prevents any other transaction from acquiring a PESSIMISTIC_READ or PESSIMISTIC_WRITE lock, and the Entity will have its optimistic lock version incremented on commit. This is unusual as it does both an optimistic and pessimistic lock, normally an application would only use one locking model.

- NONE == LockMode.NONE
No lock is acquired, this is the default to any find, refresh or query operation.


Thank you so much,

Best regards.


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.