diff options
-rw-r--r-- | java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java | 18 | ||||
-rw-r--r-- | java/broker/src/main/java/org/apache/qpid/server/transport/ServerSession.java | 19 |
2 files changed, 25 insertions, 12 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java b/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java index 3b17da5af7..54a05da84d 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java +++ b/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java @@ -200,16 +200,22 @@ public class AMQChannel implements SessionConfig private void incrementOutstandingTxnsIfNecessary() { - //There can currently only be at most one outstanding transaction - //due to only having LocalTransaction support. Set value to 1 if 0. - _txnCount.compareAndSet(0,1); + if(isTransactional()) + { + //There can currently only be at most one outstanding transaction + //due to only having LocalTransaction support. Set value to 1 if 0. + _txnCount.compareAndSet(0,1); + } } private void decrementOutstandingTxnsIfNecessary() { - //There can currently only be at most one outstanding transaction - //due to only having LocalTransaction support. Set value to 0 if 1. - _txnCount.compareAndSet(1,0); + if(isTransactional()) + { + //There can currently only be at most one outstanding transaction + //due to only having LocalTransaction support. Set value to 0 if 1. + _txnCount.compareAndSet(1,0); + } } public Long getTxnStarts() diff --git a/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSession.java b/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSession.java index 63d540be6b..b5d5d7bba9 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSession.java +++ b/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSession.java @@ -401,6 +401,7 @@ public class ServerSession extends Session implements PrincipalHolder, SessionCo public void selectTx() { _transaction = new LocalTransaction(this.getMessageStore()); + _txnStarts.incrementAndGet(); } public void commit() @@ -424,16 +425,22 @@ public class ServerSession extends Session implements PrincipalHolder, SessionCo private void incrementOutstandingTxnsIfNecessary() { - //There can currently only be at most one outstanding transaction - //due to only having LocalTransaction support. Set value to 1 if 0. - _txnCount.compareAndSet(0,1); + if(isTransactional()) + { + //There can currently only be at most one outstanding transaction + //due to only having LocalTransaction support. Set value to 1 if 0. + _txnCount.compareAndSet(0,1); + } } private void decrementOutstandingTxnsIfNecessary() { - //There can currently only be at most one outstanding transaction - //due to only having LocalTransaction support. Set value to 0 if 1. - _txnCount.compareAndSet(1,0); + if(isTransactional()) + { + //There can currently only be at most one outstanding transaction + //due to only having LocalTransaction support. Set value to 0 if 1. + _txnCount.compareAndSet(1,0); + } } public Long getTxnStarts() |