I have a scenario for a web applicatio were two users modify the same data and I have to refresh object state to make some checkin before comit some data.
I'll try to be a little more explicit:
Code:
//user1
Object obj1 = session1.load(.., pk);
//user2
Object obj2 = session2.load(.., pk); //obj1 is the same persistent object as obj2
obj2.setXXX();
session2.update(obj2);
session2.commit();
//user1
Object obj3 = session3.load(.., pk); //ob3 is the same as obj2, obj1
session3.refresh(obj1);
//some logic here
When I refresh obj1 using session3 I still don't see the changes comited with session2