I have two client applications. Both applications are running (in separate VMs).
The first application carries out a query using session.find(String). The session is closed following the query.
The second application updates an object that was a child of the object returned in the above query using session.saveOrUpdate() and a transaction commit: the changes are reflected immediately in the database. The session is closed following the update.
The first application carries out the same query it did the first time. To my surprise, it does not show the changes that the second application has made to the object.
When (if ever) does Hibernate check to see if objects it has cached on return from a query are dirty? How can I remedy/control this situation?
Note that the two applications are running in different VMs and are therefore using separate database connections and separate session factories. The session factory is alive for the whole application lifetime, but the sessions are created and closed with each query or update.
Thanks,
Gareth.
|