Add TM Locator impl to JMSBridge tests
Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/39c61014 Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/39c61014 Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/39c61014 Branch: refs/heads/master Commit: 39c61014ac6bb755c3afeeb9fdbe5d3121b6f4b8 Parents: 64cc435 Author: Martyn Taylor <[email protected]> Authored: Fri Dec 12 12:51:23 2014 +0000 Committer: Martyn Taylor <[email protected]> Committed: Tue Dec 16 16:33:58 2014 +0000 ---------------------------------------------------------------------- .../apache/activemq/jms/bridge/impl/JMSBridgeImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-6/blob/39c61014/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/impl/JMSBridgeImpl.java ---------------------------------------------------------------------- diff --git a/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/impl/JMSBridgeImpl.java b/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/impl/JMSBridgeImpl.java index fed9420..cefc928 100644 --- a/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/impl/JMSBridgeImpl.java +++ b/activemq-jms-server/src/main/java/org/apache/activemq/jms/bridge/impl/JMSBridgeImpl.java @@ -402,7 +402,10 @@ public final class JMSBridgeImpl implements JMSBridge checkParams(); - TransactionManager tm = ServiceUtils.getTransactionManager(); + if (tm == null) + { + tm = ServiceUtils.getTransactionManager(); + } // There may already be a JTA transaction associated to the thread @@ -1015,7 +1018,10 @@ public final class JMSBridgeImpl implements JMSBridge ActiveMQJMSBridgeLogger.LOGGER.trace("Starting JTA transaction"); } - TransactionManager tm = ServiceUtils.getTransactionManager(); + if (tm == null) + { + tm = ServiceUtils.getTransactionManager(); + } // Set timeout to a large value since we do not want to time out while waiting for messages // to arrive - 10 years should be enough
