Hmmm... I am wondering what is going on under the hood here. It might help to see some code (from the application that you have to restart) but I also have a theory that it could all be about transaction isolation levels.
Are you using transactions and have you made sure that you are ALWAYS either calling commit or rollback after every unit-of-work?
Are you using the default Hibernate connection pool?
Do you know what transaction isolation level your connections are using? Could it be set to REPEATABLE READ?
The reason for the questions is that we had a similar problem a long time ago during some prototype development and discovered that:
a) We didn't commit or rollback the transaction. The session itself was closed but the underlying connection was just returned to the connection pool.
b) The default transaction isolation level was REPEATABLE READ.
c) So, when a second session was created it was given the same connection as the first session had been used. And since the transaction was still open in a REPEATABLE READ mode we would always get the same result as we got from the first session.
The solution to this problem was
a) Always make sure that transactions are committed or rolled back.
b) Use a better connection pool, such as C3PO that usually commits/rollbacks transactions for you (at least I think it does because I remember that the problem got away when we started using it).
b) Set the transaction isolation level to something else, for example READ COMMITTED. This can be done in your hibernate configuration file. See 'hibernate.connection.isolation' at
http://www.hibernate.org/hib_docs/v3/re ... ernatejdbc