From c9c6e62a601daa1cc7f165b94a4219fcd0404f9a Mon Sep 17 00:00:00 2001 From: Bruce Snyder Date: Fri, 12 Nov 2010 15:39:37 +0000 Subject: [PATCH] AMQ-3022 - Reverting changes for transaction suspend/resume due to broken tests git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1034430 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/activemq/TransactionContext.java | 45 +++++++++---------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java b/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java index f57c79ebf0..3499b993ca 100755 --- a/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java +++ b/activemq-core/src/main/java/org/apache/activemq/TransactionContext.java @@ -164,7 +164,7 @@ public class TransactionContext implements XAResource { } catch (Throwable e) { throw JMSExceptionSupport.create(e); } finally { - synchronizations = null; + synchronizations = null; } } @@ -334,17 +334,12 @@ public class TransactionContext implements XAResource { throw new XAException(XAException.XAER_PROTO); } - String txSuspendResumeNotSupportMsg = "The suspend/resume of a transaction " - + "is not supported. Instead it is recommended that a new JMS session be created."; - - if ((flags & TMJOIN) == TMJOIN) { - throw new XAException(txSuspendResumeNotSupportMsg); + // if ((flags & TMJOIN) == TMJOIN) { // TODO: verify that the server has seen the xid - } - if ((flags & TMRESUME) == TMRESUME) { - throw new XAException(txSuspendResumeNotSupportMsg); - // TODO: verify that the xid was suspended. - } + // // } + // if ((flags & TMJOIN) == TMRESUME) { + // // TODO: verify that the xid was suspended. + // } // associate synchronizations = null; @@ -705,20 +700,20 @@ public class TransactionContext implements XAResource { * @return the response */ private Response syncSendPacketWithInterruptionHandling(Command command) throws JMSException { - try { - return this.connection.syncSendPacket(command); - } catch (JMSException e) { - if (e.getLinkedException() instanceof InterruptedIOException) { - try { - Thread.interrupted(); - return this.connection.syncSendPacket(command); - } finally { - Thread.currentThread().interrupt(); - } - } - - throw e; - } + try { + return this.connection.syncSendPacket(command); + } catch (JMSException e) { + if (e.getLinkedException() instanceof InterruptedIOException) { + try { + Thread.interrupted(); + return this.connection.syncSendPacket(command); + } finally { + Thread.currentThread().interrupt(); + } + } + + throw e; + } } /**