steve wrote:
Sessions are not "managed" objects, meaning Hibernate does not keep track of opened sessions; that is the applications responibility.
However, this should be easy enough to set up. The best approach would depend on your exact setup, but there are a number of ways to implement this.
I am using the Thread Local pattern to create one Session for every thread. Hovever, I am afraid some threads died or some other reasons didn't close the session because there are a variety of clients accessing the database and opening session and different clients are developed by different team members. I want to trace if there any unclosed session when the system is in the production.
As you said, there are a number of ways to implement this. Could you please give me some hint? I don't really know how to access the thread's local data.
Thanks for your help!
Edmond