mirror of https://github.com/apache/activemq.git
https://issues.apache.org/activemq/browse/AMQ-2594 - synchronizing transaction store commit and triggering afterCommit event
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@923694 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
24a7626b06
commit
8183ed5c90
|
@ -67,18 +67,20 @@ public class LocalTransaction extends Transaction {
|
|||
|
||||
setState(Transaction.FINISHED_STATE);
|
||||
context.getTransactions().remove(xid);
|
||||
transactionStore.commit(getTransactionId(), false);
|
||||
synchronized (transactionStore) {
|
||||
transactionStore.commit(getTransactionId(), false);
|
||||
|
||||
try {
|
||||
fireAfterCommit();
|
||||
} catch (Throwable e) {
|
||||
// I guess this could happen. Post commit task failed
|
||||
// to execute properly.
|
||||
LOG.warn("POST COMMIT FAILED: ", e);
|
||||
XAException xae = new XAException("POST COMMIT FAILED");
|
||||
xae.errorCode = XAException.XAER_RMERR;
|
||||
xae.initCause(e);
|
||||
throw xae;
|
||||
try {
|
||||
fireAfterCommit();
|
||||
} catch (Throwable e) {
|
||||
// I guess this could happen. Post commit task failed
|
||||
// to execute properly.
|
||||
LOG.warn("POST COMMIT FAILED: ", e);
|
||||
XAException xae = new XAException("POST COMMIT FAILED");
|
||||
xae.errorCode = XAException.XAER_RMERR;
|
||||
xae.initCause(e);
|
||||
throw xae;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -90,16 +92,18 @@ public class LocalTransaction extends Transaction {
|
|||
}
|
||||
setState(Transaction.FINISHED_STATE);
|
||||
context.getTransactions().remove(xid);
|
||||
transactionStore.rollback(getTransactionId());
|
||||
synchronized (transactionStore) {
|
||||
transactionStore.rollback(getTransactionId());
|
||||
|
||||
try {
|
||||
fireAfterRollback();
|
||||
} catch (Throwable e) {
|
||||
LOG.warn("POST ROLLBACK FAILED: ", e);
|
||||
XAException xae = new XAException("POST ROLLBACK FAILED");
|
||||
xae.errorCode = XAException.XAER_RMERR;
|
||||
xae.initCause(e);
|
||||
throw xae;
|
||||
try {
|
||||
fireAfterRollback();
|
||||
} catch (Throwable e) {
|
||||
LOG.warn("POST ROLLBACK FAILED: ", e);
|
||||
XAException xae = new XAException("POST ROLLBACK FAILED");
|
||||
xae.errorCode = XAException.XAER_RMERR;
|
||||
xae.initCause(e);
|
||||
throw xae;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue