mirror of https://github.com/apache/activemq.git
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:
parent
e4dfd570b9
commit
4ce57a618e
|
@ -220,13 +220,18 @@ 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 (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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue