activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1065688 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/TransactionContext.java test/java/org/apache/activemq/store/jdbc/JDBCXACommitExceptionTest.java
Date Mon, 31 Jan 2011 17:20:18 GMT
Author: gtully
Date: Mon Jan 31 17:20:18 2011
New Revision: 1065688

URL: http://svn.apache.org/viewvc?rev=1065688&view=rev
Log:
resolve regression in JDBCXACommitExceptionTest from https://issues.apache.org/activemq/browse/AMQ-2880
Change http://svn.apache.org/viewvc?rev=1064858&view=rev demostrated need to separate
jms transacted
session recovery from xa recovery.
Issue related to using XASession without transactions. https://issues.apache.org/jira/browse/AMQ-2659
fix makes XASession indicated it is transacted during commit processing so that a close does
not precipiate
an auto ack. ended transactions, available till forget will keep transacted=true

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/JDBCXACommitExceptionTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java?rev=1065688&r1=1065687&r2=1065688&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java
Mon Jan 31 17:20:18 2011
@@ -88,7 +88,7 @@ public class TransactionContext implemen
     }
 
     public boolean isInXATransaction() {
-        return transactionId != null && transactionId.isXATransaction();
+        return (transactionId != null && transactionId.isXATransaction()) || !ENDED_XA_TRANSACTION_CONTEXTS.isEmpty();
     }
 
     public boolean isInLocalTransaction() {
@@ -579,6 +579,7 @@ public class TransactionContext implemen
         } catch (JMSException e) {
             throw toXAException(e);
         }
+        ENDED_XA_TRANSACTION_CONTEXTS.remove(x);
     }
 
     public boolean isSameRM(XAResource xaResource) throws XAException {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/JDBCXACommitExceptionTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/JDBCXACommitExceptionTest.java?rev=1065688&r1=1065687&r2=1065688&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/JDBCXACommitExceptionTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/JDBCXACommitExceptionTest.java
Mon Jan 31 17:20:18 2011
@@ -108,7 +108,7 @@ public class JDBCXACommitExceptionTest e
                 LOG.debug("Caught exception:", e);
 
                 try {
-                    LOG.debug("Rolling back transaction (just in case, no need to do this
as it is implicit in a commit failure) " + tid);
+                    LOG.debug("Rolling back transaction (just in case, no need to do this
as it is implicit in a 1pc commit failure) " + tid);
                     resource.rollback(tid);
                 }
                 catch (XAException ex) {



Mime
View raw message