Jun 18th, 2007, 09:15 PM
jpa & hibernate lock()
Hi, i'd like to know if the pessimistic locking in hibernate works the same as with the entity manager in jpa.
I've been reading in diferent books ffrom where i undesratand
that the hibernate lock() (F.E. WRITELOCK) prevents concurrent threads to access the locked object till the transaction finishes.(I think this works like a kind of mutex)
But in jpa, the lock(), just increments the version number.
I'm interested in undestanding this because i need a kind of mutext behaivour, to prevent concurrent thread to read and update an object, which i used to give unique ids.
Thanks for your help!