I have loaded an entity into my transaction and have changed a property of that entity. The transaction is not yet commited. Now I would like to get the original value of the changed property.
I've tried with a HQL query like select p.property from Person p where p.id = 1
with the ID of the entity loaded in the transaction.
I've set query.setHint("org.hibernate.cacheMode", CacheMode.IGNORE);
before executing the query. But no success. Hibernate returns the value as set in the current transaction, not the one from the database.
Is there any way around this?