• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pessimistic locking Hibernate Entity Manager

 
Priya Venkatesan
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone tell me how the pessimistic locking mechanism is implemented by the Hibernate Entity Manager?
 
Arun Kumarr
Ranch Hand
Posts: 661
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this link.
See if it answers your question.

http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/transactions.html
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For databases that support the SELECT´┐ŻFOR UPDATE syntax look for uses of the LockMode class/enumeration
like Session.lock(Object object, LockMode lockMode) and Session.get(Class clazz, Serializable id, LockMode lockMode).

As a last resort you can implement a Pessimistic Offline Lock by defining an Entity Lock class that updates the record's locking columns separately from the remaining entity columns.
[ April 17, 2006: Message edited by: Peer Reynders ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic