activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-5953 - transaction broker, fix sync of xatransaction get with insert
Date Thu, 03 Sep 2015 16:01:55 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 0f492f3b4 -> c7b93d123


https://issues.apache.org/jira/browse/AMQ-5953 - transaction broker, fix sync of xatransaction
get with insert


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/c7b93d12
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/c7b93d12
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/c7b93d12

Branch: refs/heads/master
Commit: c7b93d123228a8501e41956493859e581ef0533b
Parents: 0f492f3
Author: gtully <gary.tully@gmail.com>
Authored: Thu Sep 3 16:55:42 2015 +0100
Committer: gtully <gary.tully@gmail.com>
Committed: Thu Sep 3 16:56:20 2015 +0100

----------------------------------------------------------------------
 .../org/apache/activemq/broker/TransactionBroker.java    | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/c7b93d12/activemq-broker/src/main/java/org/apache/activemq/broker/TransactionBroker.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/TransactionBroker.java
b/activemq-broker/src/main/java/org/apache/activemq/broker/TransactionBroker.java
index caea29f..33426de 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/TransactionBroker.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/TransactionBroker.java
@@ -336,11 +336,14 @@ public class TransactionBroker extends BrokerFilter {
     //
     // ////////////////////////////////////////////////////////////////////////////
     public Transaction getTransaction(ConnectionContext context, TransactionId xid, boolean
mightBePrepared) throws JMSException, XAException {
-        Map transactionMap = null;
-        synchronized (xaTransactions) {
-            transactionMap = xid.isXATransaction() ? xaTransactions : context.getTransactions();
+        Transaction transaction = null;
+        if (xid.isXATransaction()) {
+            synchronized (xaTransactions) {
+                transaction = xaTransactions.get(xid);
+            }
+        } else {
+            transaction = context.getTransactions().get(xid);
         }
-        Transaction transaction = (Transaction)transactionMap.get(xid);
         if (transaction != null) {
             return transaction;
         }


Mime
View raw message