https://issues.apache.org/activemq/browse/AMQ-2594 - including the test and adding some comments

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@923706 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2010-03-16 12:21:14 +00:00
parent 8183ed5c90
commit 5cc101beae
2 changed files with 4 additions and 2 deletions

View File

@ -512,8 +512,6 @@
<!-- used just to test potential memory leaks manually --> <!-- used just to test potential memory leaks manually -->
<exclude>**/JDBCTestMemory.*</exclude> <exclude>**/JDBCTestMemory.*</exclude>
<!-- exclude until AMQ-2594 is fixed-->
<exclude>**/JDBCNegativeQueueTest.*</exclude>
<exclude>**/amq1490/*</exclude> <exclude>**/amq1490/*</exclude>
<exclude>**/AMQ1925*</exclude> <exclude>**/AMQ1925*</exclude>

View File

@ -67,6 +67,8 @@ public class LocalTransaction extends Transaction {
setState(Transaction.FINISHED_STATE); setState(Transaction.FINISHED_STATE);
context.getTransactions().remove(xid); context.getTransactions().remove(xid);
// Sync on transaction store to avoid out of order messages in the cursor
// https://issues.apache.org/activemq/browse/AMQ-2594
synchronized (transactionStore) { synchronized (transactionStore) {
transactionStore.commit(getTransactionId(), false); transactionStore.commit(getTransactionId(), false);
@ -92,6 +94,8 @@ public class LocalTransaction extends Transaction {
} }
setState(Transaction.FINISHED_STATE); setState(Transaction.FINISHED_STATE);
context.getTransactions().remove(xid); context.getTransactions().remove(xid);
// Sync on transaction store to avoid out of order messages in the cursor
// https://issues.apache.org/activemq/browse/AMQ-2594
synchronized (transactionStore) { synchronized (transactionStore) {
transactionStore.rollback(getTransactionId()); transactionStore.rollback(getTransactionId());