mirror of https://github.com/apache/activemq.git
resolve https://issues.apache.org/activemq/browse/AMQ-2346 - TransactionContext XA state needs to be static to be shared across XAResource views
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@811003 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
26eb49f259
commit
d88004fe5d
|
@ -1435,7 +1435,7 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
|
|||
|
||||
if (isConnectionInfoSentToBroker) {
|
||||
if (!transportFailed.get() && !closing.get()) {
|
||||
asyncSendPacket(info.createRemoveCommand());
|
||||
syncSendPacket(info.createRemoveCommand());
|
||||
}
|
||||
isConnectionInfoSentToBroker = false;
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ public class TransactionContext implements XAResource {
|
|||
private static final Log LOG = LogFactory.getLog(TransactionContext.class);
|
||||
|
||||
// XATransactionId -> ArrayList of TransactionContext objects
|
||||
private final ConcurrentHashMap<TransactionId, List<TransactionContext>> ENDED_XA_TRANSACTION_CONTEXTS = new ConcurrentHashMap<TransactionId, List<TransactionContext>>();
|
||||
private final static ConcurrentHashMap<TransactionId, List<TransactionContext>> ENDED_XA_TRANSACTION_CONTEXTS = new ConcurrentHashMap<TransactionId, List<TransactionContext>>();
|
||||
|
||||
private final ActiveMQConnection connection;
|
||||
private final LongSequenceGenerator localTransactionIdGenerator;
|
||||
|
|
|
@ -63,8 +63,14 @@ public class JmsXARollback2CxTransactionTest extends JmsQueueTransactionTest {
|
|||
return (ConnectionFactory) managedConnectionFactory.createConnectionFactory(connectionManager);
|
||||
}
|
||||
|
||||
public void xtestRepeatReceiveTwoThenRollback() throws Exception {
|
||||
public void testReconnectWithClientId() throws Exception {
|
||||
for (index = 0; index< 20; index ++) {
|
||||
reconnect();
|
||||
}
|
||||
}
|
||||
|
||||
public void testRepeatReceiveTwoThenRollback() throws Exception {
|
||||
for (index = 0; index< 2; index ++) {
|
||||
testReceiveTwoThenRollback();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue