working on struts/hibernate for content-admin
[mir.git] / source / mir / core / ui / plugin / HibernatePlugin.java
index d1784f4..664c5e9 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.4 2003/12/20 20:27:09 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();
+                       }
+               }
        }
 
        /**
@@ -60,7 +68,8 @@ public class HibernatePlugin implements PlugIn {
         */
        public void init(ActionServlet actionServlet, ModuleConfig config)
                throws ServletException {
-               try {
+    //BasicConfigurator.configure();
+    try {
                        SessionFactory factory = 
                                new Configuration().configure().buildSessionFactory();
                        actionServlet.getServletContext()