I've implemented a struts 2 interceptor to create hibernate's SessionFactory
and manage sessions. My session factory is wrapped in a static class:
public static SessionFactory factory;
static {
try {
Configuration cf = new Configuration();
factory = cf.configure().buildSessionFactory();
} catch (Throwable ex) {
throw new ExceptionInInitializerError(ex);
}
}
The problem is that every time I undeploy or redeploy my application,
connections to the database persist because I don't call the
sessionfactory.close() method.
How can I call this method right before tomcat undeploys the application?
--
View this message in context:
http://www.nabble.com/Closing-Hibernate%27s-SessionFactory-when-undeploying-%28or-when-is-a-filter-destroyed%29-tf4402912.html#a12560350
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To start a new topic, e-mail: [email protected]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]