AMQ-2922 Fixed the issue of KahaDBTransactionStore doesn' t store prepare command rightly

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1151121 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Willem Ning Jiang 2011-07-26 14:49:35 +00:00
parent e4dfd570b9
commit 4ce57a618e
1 changed files with 9 additions and 4 deletions

View File

@ -220,15 +220,20 @@ public class KahaDBTransactionStore implements TransactionStore {
* @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 (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);
}
}
}
}
public Tx getTx(Object txid) {
Tx tx = inflightTransactions.get(txid);