Hi. I have a problem with LockMode. I'm relatively new with Hibernate, so maybe I'm missing something.
When I do something like this with an open session:
Code:
MyClass obj=(MyClass)session.get(MyClass.class,pk)
I obtain a shared read lock on the row corresponding to the object obj (LockMode.READ).
Yet, when I do something like this:
Code:
List<MyClass> list=session.createCriteria(MyClass.class).setLockMode(LockMode.READ).add(Restrictions.like("myProp", prop+"%")).list();
I do NOT obtain a shared lock on the row corresponding to the objects contained in the list. Is this behaviour correct or there is something wrong with my test or my database?
I'm using MySql ndbcluster as datastore.
Thank you
Davide