summaryrefslogtreecommitdiff
path: root/qpid/java
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2010-03-10 14:38:39 +0000
committerRobert Gemmell <robbie@apache.org>2010-03-10 14:38:39 +0000
commitebabd3f43efc4899ad3d0008a1ffee275d572c84 (patch)
tree3dcf04a508e97d83e0411d8fdab09a83e9744264 /qpid/java
parenta66906f8d45fae417f288cdd51a417af2ccd5e5a (diff)
downloadqpid-python-ebabd3f43efc4899ad3d0008a1ffee275d572c84.tar.gz
QPID-2379: only inc/dec the outstanding txn count if the channel/session is transactional, obviously. Inc txnStart on ServerSession when selectTX is invoked.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@921371 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java18
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSession.java19
2 files changed, 25 insertions, 12 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
index 3b17da5af7..54a05da84d 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
+++ b/qpid/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/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSession.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSession.java
index 63d540be6b..b5d5d7bba9 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSession.java
+++ b/qpid/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()