Beginner |
|
Joined: Tue Nov 18, 2003 12:34 am Posts: 39 Location: Dallas, Texas, US
|
Hello,
I have a factory method to encapsulate the OpenSession() in HibernateSesssionFactory and it does not store any reference to the created sessions. And now I need add a shutdownhook to my application in order to complete any pending transactions and to release database locks. Is there a way to get the references of the created sessions (JDBC) from hibernate so that I can call flush/commit/rollback/clean method on each of them? I would think I would have to work with the connection pool (I am currently using Hibernate's connection pool).
The easiest way would be to store the references, but it would be difficult to "maintain" the reference table. My guess is that the connection pool should have this info anyway that I can make use of. Please suggest any ideas on how to achieve this.
Thank you very much,
Madhan.
|
|