Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
3.2.1.ga:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Oracle 10g
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html
Hello,
I am just playing around with pessimistic locking and I need a bit of clarification. I tried using two notations to use pessimistic locking.
1. call session.get(Class, id, LockMode)
2. call session.lock( Object, LockMode)
The first option behaves as I would expect it to with "select for update". If there are two threads T1 and T2, the second thread T2 will block on the line. After T1 commits T2 will continue. T2 will read the new values committed by T1.
However the second notations with session.lock (Object, LockMode.UPGRADE) is confusing me a bit. In the second case T2 will block as well and continue after T1 commits. When T2 unblocks and performs a read it will not see changes committed by T1.
What is the purpose of this second notation? Even though it blocks it doesn't pick up committed changes by T1. I am using Oracle with default read-committed isolation.
Thank you.