Java: Hibernate does not see changes in DataBase
I have two different applications that share the same database. The problem is that when I have an application change something in the database, the other does not update. I tried to make a session.flush() but it didn't work. The only way is to close the entire session and recreate it, but of course, that takes too long. Short answer: issue a session.refresh(obj) every time you want to display some object. It will force Hibernate to go to the database. Another solution is to use a StatelessSession , which won't cache anything (not even 1st level cache), forcing your applications to go the