I am using PostgreSQL and Hibernate.
I want an entity to be same with Database record. When DB record changes, I want to change the entity I have also.
Is it possible to do such a thing with hibernate.
Thanks
EDIT
Here is my scenario. There are some variables I keep as Application Scope. Normally I store them on the memory.
But now, I want to setup a database server on a machine and two same deployment on two different server. Some times these application scoped variables can change. So, to keep these two servers synchronized, these application scoped variables have to be same.
When one of them updates the entity, I want to know and change the entity on the other server. But I don't want to do keeping select queries to check whether it is changed or not. Some how, I want the entity to change or I want hibernate to tell me it is changed.
I hope, I am clear. If not please let me know. I can provide more info if needed.