Hi,
I have bound an object to the session. While the session is open I want to check if the object has been modified
in the database (the object is not changed in the session!!).
Something like this:
Code:
O object = Session.get(O.class, id)
// do something with other objects in the session
session.saveOrUpdate(anotherObject);
...
...
-> finally check here if object has been modified in the database
I tried to use optimistic locking but I could not get it to work if the object has not been changed in the session.
Currently I manually check for modifications.
So is there another way to find out if the object has been changed?
Best Regards
Carsten