mirror of https://github.com/apache/activemq.git
resolve regression of some ra transaction tests, follow on from http://svn.apache.org/viewvc?view=revision&revision=1065688 - a shared context needs to be aware that ended transactions that are unresolved are considered active. browse needs to only commit for local transactions when ending
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1069796 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
971f61f0d3
commit
8fdf3457e3
|
@ -113,7 +113,7 @@ public class ActiveMQQueueBrowser implements QueueBrowser, Enumeration {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (session.getTransacted()) {
|
if (session.getTransacted() && session.getTransactionContext().isInLocalTransaction()) {
|
||||||
session.commit();
|
session.commit();
|
||||||
}
|
}
|
||||||
consumer.close();
|
consumer.close();
|
||||||
|
|
|
@ -115,7 +115,9 @@ public class ManagedTransactionContext extends TransactionContext {
|
||||||
|
|
||||||
public boolean isInXATransaction() {
|
public boolean isInXATransaction() {
|
||||||
if (useSharedTxContext) {
|
if (useSharedTxContext) {
|
||||||
return sharedContext.isInXATransaction();
|
// context considers endesd XA transactions as active, so just check for presence
|
||||||
|
// of tx when it is shared
|
||||||
|
return sharedContext.isInTransaction();
|
||||||
} else {
|
} else {
|
||||||
return super.isInXATransaction();
|
return super.isInXATransaction();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue