Author: gsim
Date: Mon Nov  5 05:17:01 2007
New Revision: 591986

URL: http://svn.apache.org/viewvc?rev=591986&view=rev
Log:
Suspension of one xid on a channel should allow for work on other xids to be 
done prior to resuming the initial xid.


Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.h

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp?rev=591986&r1=591985&r2=591986&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp Mon Nov  5 
05:17:01 2007
@@ -185,10 +185,23 @@
 
     checkDtxTimeout();
     dtxBuffer->setSuspended(true);
+    suspendedXids[xid] = dtxBuffer;
+    dtxBuffer.reset();
 }
 
 void SemanticState::resumeDtx(const std::string& xid)
 {
+    if (!dtxSelected) {
+        throw CommandInvalidException(QPID_MSG("Session has not been selected 
for use with dtx"));
+    }
+
+    dtxBuffer = suspendedXids[xid];
+    if (!dtxBuffer) {
+        throw CommandInvalidException(QPID_MSG("xid " << xid << " not 
attached"));
+    } else {
+        suspendedXids.erase(xid);
+    }
+
     if (dtxBuffer->getXid() != xid) {
         throw CommandInvalidException(
             QPID_MSG("xid specified on start was " << dtxBuffer->getXid() << 
", but " << xid << " specified on resume"));

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.h
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.h?rev=591986&r1=591985&r2=591986&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.h Mon Nov  5 
05:17:01 2007
@@ -103,6 +103,7 @@
     };
 
     typedef std::map<std::string,ConsumerImpl::shared_ptr> ConsumerImplMap;
+    typedef std::map<std::string, DtxBuffer::shared_ptr> DtxBufferMap;
 
     SessionState& session;
     DeliveryAdapter& deliveryAdapter;
@@ -117,6 +118,7 @@
     TxBuffer::shared_ptr txBuffer;
     DtxBuffer::shared_ptr dtxBuffer;
     bool dtxSelected;
+    DtxBufferMap suspendedXids;
     framing::AccumulatedAck accumulatedAck;
     bool flowActive;
 


Reply via email to