qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject svn commit: r1068661 - /qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java
Date Tue, 08 Feb 2011 22:53:12 GMT
Author: rajith
Date: Tue Feb  8 22:53:12 2011
New Revision: 1068661

URL: http://svn.apache.org/viewvc?rev=1068661&view=rev
Log:
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.

Modified:
    qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java

Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java?rev=1068661&r1=1068660&r2=1068661&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java Tue Feb
 8 22:53:12 2011
@@ -532,11 +532,21 @@ public class Session extends SessionInvo
     {
         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())



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message