activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1069796 - in /activemq/trunk: activemq-core/src/main/java/org/apache/activemq/ActiveMQQueueBrowser.java activemq-ra/src/main/java/org/apache/activemq/ra/ManagedTransactionContext.java
Date Fri, 11 Feb 2011 13:48:33 GMT
Author: gtully
Date: Fri Feb 11 13:48:33 2011
New Revision: 1069796

URL: http://svn.apache.org/viewvc?rev=1069796&view=rev
Log:
resolve regression of some ra transaction tests, follow on from http://svn.apache.org/viewvc?view=revision&revision=1065688
- a shared context needs to be aware that ended transactions that are unresolved are considered
active. browse needs to only commit for local transactions when ending

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQQueueBrowser.java
    activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ManagedTransactionContext.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQQueueBrowser.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQQueueBrowser.java?rev=1069796&r1=1069795&r2=1069796&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQQueueBrowser.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQQueueBrowser.java
Fri Feb 11 13:48:33 2011
@@ -113,7 +113,7 @@ public class ActiveMQQueueBrowser implem
             return;
         }
         try {
-            if (session.getTransacted()) {
+            if (session.getTransacted() && session.getTransactionContext().isInLocalTransaction())
{
                 session.commit();
             }
             consumer.close();

Modified: activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ManagedTransactionContext.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ManagedTransactionContext.java?rev=1069796&r1=1069795&r2=1069796&view=diff
==============================================================================
--- activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ManagedTransactionContext.java
(original)
+++ activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ManagedTransactionContext.java
Fri Feb 11 13:48:33 2011
@@ -115,7 +115,9 @@ public class ManagedTransactionContext e
 
     public boolean isInXATransaction() {
         if (useSharedTxContext) {
-            return sharedContext.isInXATransaction();
+            // context considers endesd XA transactions as active, so just check for presence
+            // of tx when it is shared
+            return sharedContext.isInTransaction();
         } else {
             return super.isInXATransaction();
         }



Mime
View raw message