Hi,
I have a kinds of counter that I have to increase and I am doing the following action:
session = sf.openSession();
tx = session.beginTransaction();
DocNrCounterPJO counter = (DocNrCounterPJO ) aHibernateSession.get(DocNrCounterPJO .class, anId, aLockMode);
counter.currentStatus++;
// Do something...
Thread.sleep(10000);
session.update(counter);
session.flush();
session.commit();
session.close();
I am using Informix as target database and I saw that my row (counter) I selected is not locked. I can access it during the sleep time using an external SQL. The generated hibernate SQL statement seems to be correct (SELECT ... FOR UPDATE).
Can somebody help me? Where is the problem ?
Thanks for your answer it is very critical.
Yvan Hess
PS: I am using Hibernate 2.1.4
|