at shutdown of struts SessionFactory is detroyed to free ressources
authoridfx <idfx>
Tue, 30 Sep 2003 19:28:42 +0000 (19:28 +0000)
committeridfx <idfx>
Tue, 30 Sep 2003 19:28:42 +0000 (19:28 +0000)
source/mir/core/ui/plugin/HibernatePlugin.java

index d1784f4..d636598 100755 (executable)
@@ -44,15 +44,23 @@ import org.apache.struts.config.ModuleConfig;
 
 /**
  * HibernatePlugin
- * @version $Id: HibernatePlugin.java,v 1.2 2003/09/18 21:42:17 idfx Exp $
+ * @version $Id: HibernatePlugin.java,v 1.3 2003/09/30 19:28:42 idfx Exp $
  * @author idefix
  */
 public class HibernatePlugin implements PlugIn {
+       private SessionFactory factory;
 
        /**
         * @see org.apache.struts.action.PlugIn#destroy()
         */
        public void destroy() {
+               if(factory != null){
+                       try {
+                               factory.close();
+                       } catch (HibernateException e) {
+                               e.printStackTrace();
+                       }
+               }
        }
 
        /**