[seam-commits] Seam SVN: r7719 - trunk/src/main/org/jboss/seam/framework.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Thu Mar 27 07:00:32 EDT 2008
Author: pete.muir at jboss.org
Date: 2008-03-27 07:00:32 -0400 (Thu, 27 Mar 2008)
New Revision: 7719
Modified:
trunk/src/main/org/jboss/seam/framework/EntityController.java
trunk/src/main/org/jboss/seam/framework/EntityHome.java
trunk/src/main/org/jboss/seam/framework/EntityQuery.java
trunk/src/main/org/jboss/seam/framework/HibernateEntityController.java
trunk/src/main/org/jboss/seam/framework/HibernateEntityHome.java
trunk/src/main/org/jboss/seam/framework/HibernateEntityQuery.java
trunk/src/main/org/jboss/seam/framework/MutableEntityController.java
trunk/src/main/org/jboss/seam/framework/PersistenceController.java
Log:
JBSEAM-2780
Modified: trunk/src/main/org/jboss/seam/framework/EntityController.java
===================================================================
--- trunk/src/main/org/jboss/seam/framework/EntityController.java 2008-03-27 10:37:16 UTC (rev 7718)
+++ trunk/src/main/org/jboss/seam/framework/EntityController.java 2008-03-27 11:00:32 UTC (rev 7719)
@@ -82,4 +82,10 @@
getEntityManager().remove(entity);
}
+ @Override
+ protected boolean isPersistenceContextOpen(EntityManager persistenceContext)
+ {
+ return persistenceContext.isOpen();
+ }
+
}
Modified: trunk/src/main/org/jboss/seam/framework/EntityHome.java
===================================================================
--- trunk/src/main/org/jboss/seam/framework/EntityHome.java 2008-03-27 10:37:16 UTC (rev 7718)
+++ trunk/src/main/org/jboss/seam/framework/EntityHome.java 2008-03-27 11:00:32 UTC (rev 7719)
@@ -216,4 +216,10 @@
}
}
+ @Override
+ protected boolean isPersistenceContextOpen(EntityManager persistenceContext)
+ {
+ return persistenceContext.isOpen();
+ }
+
}
Modified: trunk/src/main/org/jboss/seam/framework/EntityQuery.java
===================================================================
--- trunk/src/main/org/jboss/seam/framework/EntityQuery.java 2008-03-27 10:37:16 UTC (rev 7718)
+++ trunk/src/main/org/jboss/seam/framework/EntityQuery.java 2008-03-27 11:00:32 UTC (rev 7719)
@@ -235,4 +235,10 @@
}
}
+ @Override
+ protected boolean isPersistenceContextOpen(EntityManager persistenceContext)
+ {
+ return persistenceContext.isOpen();
+ }
+
}
Modified: trunk/src/main/org/jboss/seam/framework/HibernateEntityController.java
===================================================================
--- trunk/src/main/org/jboss/seam/framework/HibernateEntityController.java 2008-03-27 10:37:16 UTC (rev 7718)
+++ trunk/src/main/org/jboss/seam/framework/HibernateEntityController.java 2008-03-27 11:00:32 UTC (rev 7719)
@@ -118,4 +118,10 @@
getSession().refresh(entity);
}
+ @Override
+ protected boolean isPersistenceContextOpen(Session persistenceContext)
+ {
+ return persistenceContext.isOpen();
+ }
+
}
Modified: trunk/src/main/org/jboss/seam/framework/HibernateEntityHome.java
===================================================================
--- trunk/src/main/org/jboss/seam/framework/HibernateEntityHome.java 2008-03-27 10:37:16 UTC (rev 7718)
+++ trunk/src/main/org/jboss/seam/framework/HibernateEntityHome.java 2008-03-27 11:00:32 UTC (rev 7719)
@@ -119,4 +119,10 @@
}
}
+ @Override
+ protected boolean isPersistenceContextOpen(Session persistenceContext)
+ {
+ return persistenceContext.isOpen();
+ }
+
}
Modified: trunk/src/main/org/jboss/seam/framework/HibernateEntityQuery.java
===================================================================
--- trunk/src/main/org/jboss/seam/framework/HibernateEntityQuery.java 2008-03-27 10:37:16 UTC (rev 7718)
+++ trunk/src/main/org/jboss/seam/framework/HibernateEntityQuery.java 2008-03-27 11:00:32 UTC (rev 7719)
@@ -201,5 +201,11 @@
{
this.fetchSize = fetchSize;
}
+
+ @Override
+ protected boolean isPersistenceContextOpen(Session persistenceContext)
+ {
+ return persistenceContext.isOpen();
+ }
}
Modified: trunk/src/main/org/jboss/seam/framework/MutableEntityController.java
===================================================================
--- trunk/src/main/org/jboss/seam/framework/MutableEntityController.java 2008-03-27 10:37:16 UTC (rev 7718)
+++ trunk/src/main/org/jboss/seam/framework/MutableEntityController.java 2008-03-27 11:00:32 UTC (rev 7719)
@@ -82,4 +82,10 @@
getEntityManager().remove(entity);
}
+ @Override
+ protected boolean isPersistenceContextOpen(EntityManager persistenceContext)
+ {
+ return persistenceContext.isOpen();
+ }
+
}
Modified: trunk/src/main/org/jboss/seam/framework/PersistenceController.java
===================================================================
--- trunk/src/main/org/jboss/seam/framework/PersistenceController.java 2008-03-27 10:37:16 UTC (rev 7718)
+++ trunk/src/main/org/jboss/seam/framework/PersistenceController.java 2008-03-27 11:00:32 UTC (rev 7719)
@@ -15,7 +15,7 @@
public T getPersistenceContext()
{
- if (persistenceContext==null)
+ if (persistenceContext==null || !isPersistenceContextOpen(persistenceContext))
{
persistenceContext = (T) getComponentInstance( getPersistenceContextName() );
}
@@ -28,5 +28,10 @@
}
protected abstract String getPersistenceContextName();
+
+ protected boolean isPersistenceContextOpen(T persistenceContext)
+ {
+ return false;
+ }
}
More information about the seam-commits
mailing list