diff options
author | Gordon Sim <gsim@apache.org> | 2008-05-28 12:49:11 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2008-05-28 12:49:11 +0000 |
commit | c3649a7d5f9ac3ddb10406e66baa76a7c3f1cad5 (patch) | |
tree | 6d5e78b5bf3f3ed7ef711401aae7b24eb9b48791 /cpp/src | |
parent | 568b4e92244a0491e1761bfa42baeed9d8a99431 (diff) | |
download | qpid-python-c3649a7d5f9ac3ddb10406e66baa76a7c3f1cad5.tar.gz |
QPID-1095: fixes to dtx error codes for latest spec changes.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@660924 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/broker/DtxManager.cpp | 6 | ||||
-rw-r--r-- | cpp/src/qpid/broker/DtxWorkRecord.cpp | 6 | ||||
-rw-r--r-- | cpp/src/qpid/broker/SessionAdapter.cpp | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/cpp/src/qpid/broker/DtxManager.cpp b/cpp/src/qpid/broker/DtxManager.cpp index 47f389a57d..942dbdcbc6 100644 --- a/cpp/src/qpid/broker/DtxManager.cpp +++ b/cpp/src/qpid/broker/DtxManager.cpp @@ -93,7 +93,7 @@ DtxWorkRecord* DtxManager::getWork(const std::string& xid) Mutex::ScopedLock locker(lock); WorkMap::iterator i = work.find(xid); if (i == work.end()) { - throw InvalidArgumentException(QPID_MSG("Unrecognised xid " << xid)); + throw NotFoundException(QPID_MSG("Unrecognised xid " << xid)); } return ptr_map_ptr(i); } @@ -103,7 +103,7 @@ void DtxManager::remove(const std::string& xid) Mutex::ScopedLock locker(lock); WorkMap::iterator i = work.find(xid); if (i == work.end()) { - throw InvalidArgumentException(QPID_MSG("Unrecognised xid " << xid)); + throw NotFoundException(QPID_MSG("Unrecognised xid " << xid)); } else { work.erase(i); } @@ -114,7 +114,7 @@ DtxWorkRecord* DtxManager::createWork(std::string xid) Mutex::ScopedLock locker(lock); WorkMap::iterator i = work.find(xid); if (i != work.end()) { - throw CommandInvalidException(QPID_MSG("Xid " << xid << " is already known (use 'join' to add work to an existing xid)")); + throw NotAllowedException(QPID_MSG("Xid " << xid << " is already known (use 'join' to add work to an existing xid)")); } else { return ptr_map_ptr(work.insert(xid, new DtxWorkRecord(xid, store)).first); } diff --git a/cpp/src/qpid/broker/DtxWorkRecord.cpp b/cpp/src/qpid/broker/DtxWorkRecord.cpp index fe9e42ca32..2f3febed1e 100644 --- a/cpp/src/qpid/broker/DtxWorkRecord.cpp +++ b/cpp/src/qpid/broker/DtxWorkRecord.cpp @@ -73,7 +73,7 @@ bool DtxWorkRecord::commit(bool onePhase) if (prepared) { //already prepared i.e. 2pc if (onePhase) { - throw CommandInvalidException(QPID_MSG("Branch with xid " << xid << " has been prepared, one-phase option not valid!")); + throw IllegalStateException(QPID_MSG("Branch with xid " << xid << " has been prepared, one-phase option not valid!")); } store->commit(*txn); @@ -84,7 +84,7 @@ bool DtxWorkRecord::commit(bool onePhase) } else { //1pc commit optimisation, don't need a 2pc transaction context: if (!onePhase) { - throw CommandInvalidException(QPID_MSG("Branch with xid " << xid << " has not been prepared, one-phase option required!")); + throw IllegalStateException(QPID_MSG("Branch with xid " << xid << " has not been prepared, one-phase option required!")); } std::auto_ptr<TransactionContext> localtxn = store->begin(); if (prepare(localtxn.get())) { @@ -133,7 +133,7 @@ bool DtxWorkRecord::check() //iterate through all DtxBuffers and ensure they are all ended for (Work::iterator i = work.begin(); i != work.end(); i++) { if (!(*i)->isEnded()) { - throw CommandInvalidException(QPID_MSG("Branch with xid " << xid << " not completed!")); + throw IllegalStateException(QPID_MSG("Branch with xid " << xid << " not completed!")); } else if ((*i)->isRollbackOnly()) { rolledback = true; } diff --git a/cpp/src/qpid/broker/SessionAdapter.cpp b/cpp/src/qpid/broker/SessionAdapter.cpp index 2d0edde27b..1830b2b94c 100644 --- a/cpp/src/qpid/broker/SessionAdapter.cpp +++ b/cpp/src/qpid/broker/SessionAdapter.cpp @@ -575,7 +575,7 @@ DtxRecoverResult SessionAdapter::DtxHandlerImpl::recover() void SessionAdapter::DtxHandlerImpl::forget(const Xid& xid) { //Currently no heuristic completion is supported, so this should never be used. - throw CommandInvalidException(QPID_MSG("Forget is invalid. Branch with xid " << xid << " not heuristically completed!")); + throw NotImplementedException(QPID_MSG("Forget not implemented. Branch with xid " << xid << " not heuristically completed!")); } DtxGetTimeoutResult SessionAdapter::DtxHandlerImpl::getTimeout(const Xid& xid) |