Author: gtully
Date: Thu Feb 26 18:19:58 2009
New Revision: 748258

URL: http://svn.apache.org/viewvc?rev=748258&view=rev
Log:
resolve broker unit test 
testReceiveTwoThenCloseConnection(org.apache.activemq.ra.JmsXAQueueTransactionTest):
 ra test uses Auto ack mode but the xa tx has been cleaned up so amq just sees 
a close on auto ack so it delivers the ack. AMQ-2128  Keeping the tx around 
till after the close sorts this out. One question though, with the ack mode 
supposed to be ignored, does it makes sense for the RA to use a transacted ack 
mode when there is a transaction?

Modified:
    
activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnection.java

Modified: 
activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnection.java
URL: 
http://svn.apache.org/viewvc/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnection.java?rev=748258&r1=748257&r2=748258&view=diff
==============================================================================
--- 
activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnection.java
 (original)
+++ 
activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnection.java
 Thu Feb 26 18:19:58 2009
@@ -229,13 +229,14 @@
             proxy.cleanup();
         }
         proxyConnections.clear();
-        localAndXATransaction.cleanup();
 
         try {
             ((ActiveMQConnection)physicalConnection).cleanup();
         } catch (JMSException e) {
             throw new ResourceException("Could cleanup the ActiveMQ 
connection: " + e, e);
         }
+        // defer transaction cleanup till after close so that close is aware 
of the current tx
+        localAndXATransaction.cleanup();
 
     }
 


Reply via email to