From a2313ce0fc34fbe4864445595e1db1955c4918a1 Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Fri, 16 Apr 2010 20:12:55 +0000 Subject: Fix for QPID-2420 to correctly handle restoring and commit/abort prepared transactions. The basic approach is documented in QPID-2420. This also makes improvements in the way changes are done to the tblMessageMap table which should perform much better, avoiding pulling the whole table into the broker just to add or edit or delete a single record. Also, some of the consistency checks and enforcements are moved into the database itself from the C++ code. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@935068 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/store/ms-sql/DatabaseConnection.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'cpp/src/qpid/store/ms-sql/DatabaseConnection.cpp') diff --git a/cpp/src/qpid/store/ms-sql/DatabaseConnection.cpp b/cpp/src/qpid/store/ms-sql/DatabaseConnection.cpp index 34edec8acd..3219ea526a 100644 --- a/cpp/src/qpid/store/ms-sql/DatabaseConnection.cpp +++ b/cpp/src/qpid/store/ms-sql/DatabaseConnection.cpp @@ -67,4 +67,25 @@ DatabaseConnection::close() conn = 0; } +std::string +DatabaseConnection::getErrors() +{ + long errCount = conn->Errors->Count; + if (errCount <= 0) + return ""; + // Collection ranges from 0 to nCount -1. + std::ostringstream messages; + ErrorPtr pErr = NULL; + for (long i = 0 ; i < errCount ; i++ ) { + if (i > 0) + messages << "\n"; + messages << "[" << i << "] "; + pErr = conn->Errors->GetItem(i); + messages << "Error " << pErr->Number << ": " + << (LPCSTR)pErr->Description; + } + messages << std::ends; + return messages.str(); +} + }}} // namespace qpid::store::ms_sql -- cgit v1.2.1