activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1151121 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBTransactionStore.java
Date Tue, 26 Jul 2011 14:49:35 GMT
Author: ningjiang
Date: Tue Jul 26 14:49:35 2011
New Revision: 1151121

URL: http://svn.apache.org/viewvc?rev=1151121&view=rev
Log:
AMQ-2922 Fixed the issue of KahaDBTransactionStore doesn' t store prepare command rightly

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBTransactionStore.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBTransactionStore.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBTransactionStore.java?rev=1151121&r1=1151120&r2=1151121&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBTransactionStore.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBTransactionStore.java
Tue Jul 26 14:49:35 2011
@@ -220,13 +220,18 @@ public class KahaDBTransactionStore impl
      * @see org.apache.activemq.store.TransactionStore#prepare(TransactionId)
      */
     public void prepare(TransactionId txid) throws IOException {
-        inflightTransactions.remove(txid);
         KahaTransactionInfo info = getTransactionInfo(txid);
-        Tx tx = inflightTransactions.get(txid);
-        if (tx != null) {
-            for (Journal journal : theStore.getJournalManager().getJournals(tx.destinations))
{
+        if (txid.isXATransaction() || theStore.isConcurrentStoreAndDispatchTransactions()
== false) {
+            for (Journal journal : theStore.getJournalManager().getJournals()) {
                 theStore.store(journal, new KahaPrepareCommand().setTransactionInfo(info),
true, null, null);
             }
+        } else {
+            Tx tx = inflightTransactions.remove(txid);
+            if (tx != null) {
+                for (Journal journal : theStore.getJournalManager().getJournals(tx.destinations))
{
+                    theStore.store(journal, new KahaPrepareCommand().setTransactionInfo(info),
true, null, null);
+                }
+            }
         }
     }
 



Mime
View raw message