There is scenario in my application:
1. I get objects from database:
hql = "some hql query";
Query query = session.createQuery(hql);
return query.list();
2. User makes changes on this object.
3. User is not pleased with changes and wants to reload DB version of objects. (kind of 'abort edit' action)
This is where I hit the wall. When I try to get objects second time hibernate gives me references to the same objects that are already in memory - I can tell that by comparison objects id in debug mode. But these objects in memory are changed in comparison to DB version.
How could I force hibernate to read object from DB instead of giving me reference to already changed version in memory?