diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2011-02-08 22:53:12 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2011-02-08 22:53:12 +0000 |
commit | d86c2bf8ed53f41481f397a43afbba5f61f86f8f (patch) | |
tree | 1e05d807770b62624cc9a122d5d16d074aa18c3a | |
parent | c2619b8aaf8fa95d08a58d2e6567070815b82f55 (diff) | |
download | qpid-python-d86c2bf8ed53f41481f397a43afbba5f61f86f8f.tar.gz |
QPID-2994
If the session is transactional, in the invoke method the session state is checked to see if it has dettached.
If so the session is removed from the internal map maintained by the connection object. This prevents it from being resumed.
An exception is also thrown notifying that failover may have happened in the middle of a transaction and the session is closed.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1068661 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | java/common/src/main/java/org/apache/qpid/transport/Session.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/java/common/src/main/java/org/apache/qpid/transport/Session.java b/java/common/src/main/java/org/apache/qpid/transport/Session.java index 4de578da18..fa663e58a7 100644 --- a/java/common/src/main/java/org/apache/qpid/transport/Session.java +++ b/java/common/src/main/java/org/apache/qpid/transport/Session.java @@ -532,11 +532,21 @@ public class Session extends SessionInvoker { if (m.getEncodedTrack() == Frame.L4) { + + if (state == DETACHED && transacted) + { + state = CLOSED; + connection.removeSession(this); + throw new SessionException( + "Session failed over, possibly in the middle of a transaction. " + + "Closing the session. Any Transaction in progress will be rolledback."); + } + if (m.hasPayload()) { acquireCredit(); } - + synchronized (commands) { if (state == DETACHED && m.isUnreliable()) |