From: Bill B. <pat...@us...> - 2004-06-25 04:58:24
|
User: patriot1burke Date: 04/06/24 21:58:18 Modified: src/main/org/jboss/ejb3 Ejb3Module.java Log: cleanup session factory make ConnectionConfig RUNTIME and TYPE Revision Changes Path 1.8 +13 -2 jboss-ejb3/src/main/org/jboss/ejb3/Ejb3Module.java Index: Ejb3Module.java =================================================================== RCS file: /cvsroot/jboss/jboss-ejb3/src/main/org/jboss/ejb3/Ejb3Module.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Ejb3Module.java 25 Jun 2004 03:58:42 -0000 1.7 +++ Ejb3Module.java 25 Jun 2004 04:58:17 -0000 1.8 @@ -38,7 +38,7 @@ * unit. * * @author <a href="mailto:bi...@jb...">Bill Burke</a> - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ * **/ public class Ejb3Module extends ServiceMBeanSupport implements Ejb3ModuleMBean @@ -49,6 +49,7 @@ private ServiceControllerMBean serviceController; private EARDeploymentMBean ear; private List entities; + private HibernateSessionFactory factory; public static final String ENTITY_CLASSNAMES = "ENTITIES_CLASSNAMES"; public Ejb3Module(DeploymentInfo di) @@ -205,7 +206,7 @@ protected void startService() throws Exception { Iterator it = containers.keySet().iterator(); - HibernateSessionFactory factory = createHibernateSessionFactory(); + factory = createHibernateSessionFactory(); while (it.hasNext()) { ObjectName on = (ObjectName) it.next(); @@ -232,6 +233,16 @@ log.debug("stopService, stopping container: " + con.getEjbName()); } } + if (ear != null) + { + HibernateSessionFactory hbFactory = (HibernateSessionFactory)ear.resolveMetaData(HibernateSessionFactory.class); + if (hbFactory != null) hbFactory.destroy(); + ear.getMetaData().remove(HibernateSessionFactory.class); + } + else + { + factory.destroy(); + } super.stopService(); } |