diff options
| author | Stephen D. Huston <shuston@apache.org> | 2010-04-16 20:12:55 +0000 |
|---|---|---|
| committer | Stephen D. Huston <shuston@apache.org> | 2010-04-16 20:12:55 +0000 |
| commit | a2313ce0fc34fbe4864445595e1db1955c4918a1 (patch) | |
| tree | 4757029ffe7a3970cf38d32f8775a14bef7ea259 /cpp/src/qpid/store/ms-sql/DatabaseConnection.cpp | |
| parent | eb56a638b2aea7e56c55e49b267cfe2f673afe51 (diff) | |
| download | qpid-python-a2313ce0fc34fbe4864445595e1db1955c4918a1.tar.gz | |
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
Diffstat (limited to 'cpp/src/qpid/store/ms-sql/DatabaseConnection.cpp')
| -rw-r--r-- | cpp/src/qpid/store/ms-sql/DatabaseConnection.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
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 |
