openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awh...@apache.org
Subject svn commit: r443164 - in /incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel: BrokerImpl.java StateManagerImpl.java
Date Wed, 13 Sep 2006 23:23:23 GMT
Author: awhite
Date: Wed Sep 13 16:23:22 2006
New Revision: 443164

URL: http://svn.apache.org/viewvc?view=rev&rev=443164
Log:
No need to beginOperation (and especially sync with trans) in
internal isTransactionEnding method.


Modified:
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java?view=diff&rev=443164&r1=443163&r2=443164
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
Wed Sep 13 16:23:22 2006
@@ -1642,16 +1642,11 @@
     }
 
     /**
-     * Return whether the given transaction is ending, i.e. in the 2nd phase
+     * Return whether the current transaction is ending, i.e. in the 2nd phase
      * of a commit or rollback
      */
     boolean isTransactionEnding() {
-        beginOperation(true);
-        try {
-            return (_flags & FLAG_TRANS_ENDING) != 0;
-        } finally {
-            endOperation();
-        }
+        return (_flags & FLAG_TRANS_ENDING) != 0;
     }
 
     public boolean beginOperation(boolean syncTrans) {

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java?view=diff&rev=443164&r1=443163&r2=443164
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java
Wed Sep 13 16:23:22 2006
@@ -823,9 +823,7 @@
         if (field != -1 && _meta.getField(field).isPrimaryKey())
             return;
 
-        boolean active = _broker.isActive();
-        boolean ending = _broker.isTransactionEnding();
-        if (active && !ending) {
+        if (_broker.isActive() && !_broker.isTransactionEnding()) {
             if (_broker.getOptimistic())
                 setPCState(_state.beforeOptimisticRead(this, field));
             else



Mime
View raw message