From b07b0a633be48c74122f5a0cb04eafc57fb6a96b Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Mon, 5 Nov 2007 13:17:01 +0000 Subject: Suspension of one xid on a channel should allow for work on other xids to be done prior to resuming the initial xid. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@591986 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/SemanticState.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cpp/src/qpid/broker/SemanticState.cpp') diff --git a/cpp/src/qpid/broker/SemanticState.cpp b/cpp/src/qpid/broker/SemanticState.cpp index 7339150642..8651b9034c 100644 --- a/cpp/src/qpid/broker/SemanticState.cpp +++ b/cpp/src/qpid/broker/SemanticState.cpp @@ -185,10 +185,23 @@ void SemanticState::suspendDtx(const std::string& xid) 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")); -- cgit v1.2.1