hello everybody
I'm using apache tomcat 6.0 and hibernate 3.6. My web app is implemented as a servlet that serves http POST and GET. As well I'm using the singleton pattern for creating a SessionFactory over the HibernateUtil class introduced in the hibernate tutorial.
Now I cant find a solution for following problem. I need a way to access to my db over hibernate in the process of "destroy()" in the servlet class, because i need to save some data when the web app is forced to shut down (e.g. through the tomcat manager). I always get this error "org.hibernate.HibernateException: No CurrentSessionContext configured!", because tomcat releases the jdbc driver before destroy() of the servlet is called. Using ServletContext contextDestroyed() is not working as well.
Anybody knows a way or work around to solve this problem?
Cheers Alex
|