openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r443153 - in /incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel: BrokerImpl.java StateManagerImpl.java
Date Wed, 13 Sep 2006 22:45:22 GMT
Author: skim
Date: Wed Sep 13 15:45:21 2006
New Revision: 443153

URL: http://svn.apache.org/viewvc?view=rev&rev=443153
Log:
fix for re-proxying of hashed types during commit / rollback

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=443153&r1=443152&r2=443153
==============================================================================
--- 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 15:45:21 2006
@@ -135,6 +135,7 @@
     private static final int FLAG_FLUSH_REQUIRED = 2 << 8;
     private static final int FLAG_REMOTE_LISTENER = 2 << 9;
     private static final int FLAG_RETAINED_CONN = 2 << 10;
+    private static final int FLAG_TRANS_ENDING = 2 << 11;
 
     private static final Localizer _loc =
         Localizer.forPackage(BrokerImpl.class);
@@ -1640,6 +1641,19 @@
         }
     }
 
+    /**
+     * Return whether the given 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();
+        }
+    }
+
     public boolean beginOperation(boolean syncTrans) {
         lock();
         try {
@@ -1722,6 +1736,7 @@
         try {
             assertActiveTransaction();
 
+            _flags |= FLAG_TRANS_ENDING;
             endTransaction(status);
             if (_sync != null)
                 _sync.afterCompletion(status);
@@ -1746,6 +1761,7 @@
         } finally {
             _flags &= ~FLAG_ACTIVE;
             _flags &= ~FLAG_FLUSHED;
+            _flags &= ~FLAG_TRANS_ENDING;
 
             if (_transEventManager != null 
                 && _transEventManager.hasEndListeners()) {

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=443153&r1=443152&r2=443153
==============================================================================
--- 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 15:45:21 2006
@@ -824,7 +824,8 @@
             return;
 
         boolean active = _broker.isActive();
-        if (active) {
+        boolean ending = _broker.isTransactionEnding();
+        if (active && !ending) {
             if (_broker.getOptimistic())
                 setPCState(_state.beforeOptimisticRead(this, field));
             else



Mime
View raw message