summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/SemanticState.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-11-05 13:17:01 +0000
committerGordon Sim <gsim@apache.org>2007-11-05 13:17:01 +0000
commitb07b0a633be48c74122f5a0cb04eafc57fb6a96b (patch)
treefe48ae7e58a7cdc2e11bed8361c6176a0b5712fc /cpp/src/qpid/broker/SemanticState.cpp
parentd8c35727d1ecd5d88b5919c73b2096c58ed96ccb (diff)
downloadqpid-python-b07b0a633be48c74122f5a0cb04eafc57fb6a96b.tar.gz
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
Diffstat (limited to 'cpp/src/qpid/broker/SemanticState.cpp')
-rw-r--r--cpp/src/qpid/broker/SemanticState.cpp13
1 files changed, 13 insertions, 0 deletions
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"));