From 3266019825e3d0ec8c6f8d45cdf4c1b634dd525a Mon Sep 17 00:00:00 2001 From: Gary Tully Date: Thu, 26 Feb 2009 18:19:58 +0000 Subject: [PATCH] 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? git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@748258 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/activemq/ra/ActiveMQManagedConnection.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnection.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnection.java index 6d3afe6f31..435d8832f0 100755 --- a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnection.java +++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnection.java @@ -229,13 +229,14 @@ public class ActiveMQManagedConnection implements ManagedConnection, ExceptionLi 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(); }