From 8f077522f48fba58b1f3ea1762fa8e6c4f56605b Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Tue, 8 Feb 2011 22:53:12 +0000 Subject: 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@1068661 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/qpid/transport/Session.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'qpid/java/common/src') diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java index 4de578da18..fa663e58a7 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java +++ b/qpid/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()) -- cgit v1.2.1