[seam-commits] Seam SVN: r9443 - branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/persistence.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Oct 27 11:34:58 EDT 2008


Author: manaRH
Date: 2008-10-27 11:34:57 -0400 (Mon, 27 Oct 2008)
New Revision: 9443

Modified:
   branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/persistence/ManagedHibernateSession.java
   branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/persistence/ManagedPersistenceContext.java
Log:
JBPAPP-1300

Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/persistence/ManagedHibernateSession.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/persistence/ManagedHibernateSession.java	2008-10-27 15:16:42 UTC (rev 9442)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/persistence/ManagedHibernateSession.java	2008-10-27 15:34:57 UTC (rev 9443)
@@ -144,7 +144,7 @@
       {
          throw new IllegalStateException("cannot passivate persistence context with active transaction");
       }
-      if ( session!=null && !session.isDirty() )
+      if ( session!=null && session.isOpen() && !session.isDirty() )
       {
          session.close();
          session = null;
@@ -212,7 +212,7 @@
       {
          log.debug("destroying seam managed session for session factory: " + sessionFactoryJndiName);
       }
-      if (session!=null)
+      if (session!=null && session.isOpen())
       {
          session.close();
       }

Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/persistence/ManagedPersistenceContext.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/persistence/ManagedPersistenceContext.java	2008-10-27 15:16:42 UTC (rev 9442)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/persistence/ManagedPersistenceContext.java	2008-10-27 15:34:57 UTC (rev 9443)
@@ -221,7 +221,7 @@
          log.debug("destroying seam managed persistence context for persistence unit: " + persistenceUnitJndiName);
       }
       
-      if (entityManager!=null)
+      if (entityManager!=null && entityManager.isOpen())
       {
          entityManager.close();
       }




More information about the seam-commits mailing list