I'm using Hibernate3 with Derby (db.apache.org/derby).
I'm trying to implement pessimistic locking.
I have one thread that reads a row with a
Code:
Thingy thingy = (Thingy)session.get(Thingy.class, thingyNum, LockMode.UPGRADE);
It modifies the row, then explicitly performs a transaction commit, a session flush, a session close, and the thread terminates.
A little while later another thread comes along and tries to get a LockMode.UPGRADE on that same row, but locks up until Derby decides there is a race condition and dumps the thread.
Do I misunderstand how to get rid of the lock? Or is this perhaps a problem with the Derby implementation in Hibernate?
Thanks for any help.
Chas Douglass