openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r502325 - /incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java
Date Thu, 01 Feb 2007 19:35:31 GMT
Author: clr
Date: Thu Feb  1 11:35:30 2007
New Revision: 502325

URL: http://svn.apache.org/viewvc?view=rev&rev=502325
Log:
OPENJPA-122 Added check for methods that require the EntityManager to be open but where the
Broker would throw a different exception

Modified:
    incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java

Modified: incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java?view=diff&rev=502325&r1=502324&r2=502325
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java
Thu Feb  1 11:35:30 2007
@@ -469,6 +469,7 @@
 
     public void flush() {
         assertNotCloseInvoked();
+        _broker.assertOpen();
         _broker.assertActiveTransaction();
         _broker.flush();
     }
@@ -761,6 +762,7 @@
 
     public OpenJPAQuery createNamedQuery(String name) {
         assertNotCloseInvoked();
+        _broker.assertOpen();
         try {
             QueryMetaData meta = _broker.getConfiguration().
                 getMetaDataRepositoryInstance().getQueryMetaData(null, name,
@@ -809,12 +811,14 @@
 
     public void setFlushMode(FlushModeType flushMode) {
         assertNotCloseInvoked();
+        _broker.assertOpen();
         _broker.getFetchConfiguration().setFlushBeforeQueries
             (toFlushBeforeQueries(flushMode));
     }
 
     public FlushModeType getFlushMode() {
         assertNotCloseInvoked();
+        _broker.assertOpen();
         return fromFlushBeforeQueries(_broker.getFetchConfiguration().
             getFlushBeforeQueries());
     }



Mime
View raw message