aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1693247 - /aries/trunk/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxInterceptorImpl.java
Date Wed, 29 Jul 2015 12:11:31 GMT
Author: cschneider
Date: Wed Jul 29 12:11:31 2015
New Revision: 1693247

URL: http://svn.apache.org/r1693247
Log:
Workaround for FELIX-4976

Modified:
    aries/trunk/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxInterceptorImpl.java

Modified: aries/trunk/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxInterceptorImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxInterceptorImpl.java?rev=1693247&r1=1693246&r2=1693247&view=diff
==============================================================================
--- aries/trunk/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxInterceptorImpl.java
(original)
+++ aries/trunk/transaction/transaction-blueprint/src/main/java/org/apache/aries/transaction/TxInterceptorImpl.java
Wed Jul 29 12:11:31 2015
@@ -39,6 +39,8 @@ public class TxInterceptorImpl implement
     private Coordinator coordinator;
     private TxComponentMetaDataHelper metaDataHelper;
 
+    // Workaround for bug in coordinator 1.0.0 where coordinations are considered orhpaned
sometimes
+    private ThreadLocal<Coordination> localCoordination = new ThreadLocal<Coordination>();
 
     public int getRank() {
         return 1; // Higher rank than jpa interceptor to make sure transaction is started
first
@@ -56,7 +58,7 @@ public class TxInterceptorImpl implement
 
         LOGGER.debug("PreCall for bean {}, method {} with tx strategy {}.", getCmId(cm),
m.getName(), txAttribute);
         TransactionToken token = txAttribute.begin(tm);
-        coordinator.begin("txInterceptor", 0);
+        localCoordination.set(coordinator.begin("txInterceptor." + m.getDeclaringClass().getName()
+ "." + m.getName() , 0));
         return token;
     }
 
@@ -109,6 +111,7 @@ public class TxInterceptorImpl implement
         try {
             Coordination coord = coordinator.pop();
             coord.end();
+            localCoordination.set(null);
         } catch (Exception e) {
             LOGGER.warn("Error ending coordination ", e);
         }



Mime
View raw message