diff options
author | Stephen D. Huston <shuston@apache.org> | 2009-10-30 00:12:57 +0000 |
---|---|---|
committer | Stephen D. Huston <shuston@apache.org> | 2009-10-30 00:12:57 +0000 |
commit | 8039e10f1d300aaaf1b56263db5336c6c38cfd49 (patch) | |
tree | d2a6f200f7f5a5658a289455821220ddb3ce487b | |
parent | cd1db3d01244b5cfd52a622ba7ee7f4400680ca2 (diff) | |
download | qpid-python-8039e10f1d300aaaf1b56263db5336c6c38cfd49.tar.gz |
Ensure a client-side cursor is used, and change to static cursor to improve performance. When adding a new record that has a persistence ID, wait until after the Update to retrieve the new id from the new record.
Fixes QPID-2168.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@831167 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | cpp/src/qpid/store/ms-sql/BlobRecordset.cpp | 3 | ||||
-rw-r--r-- | cpp/src/qpid/store/ms-sql/Recordset.cpp | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/cpp/src/qpid/store/ms-sql/BlobRecordset.cpp b/cpp/src/qpid/store/ms-sql/BlobRecordset.cpp index 977eb6d5d2..5a5d23c797 100644 --- a/cpp/src/qpid/store/ms-sql/BlobRecordset.cpp +++ b/cpp/src/qpid/store/ms-sql/BlobRecordset.cpp @@ -49,9 +49,10 @@ BlobRecordset::add(const qpid::broker::Persistable& item) { BlobEncoder blob (item); // Marshall item info to a blob rs->AddNew(); - item.setPersistenceId(rs->Fields->Item["persistenceId"]->Value); rs->Fields->GetItem("fieldTableBlob")->AppendChunk(blob); rs->Update(); + uint64_t id = rs->Fields->Item["persistenceId"]->Value; + item.setPersistenceId(id); } void diff --git a/cpp/src/qpid/store/ms-sql/Recordset.cpp b/cpp/src/qpid/store/ms-sql/Recordset.cpp index 49232ababa..e1a5158c87 100644 --- a/cpp/src/qpid/store/ms-sql/Recordset.cpp +++ b/cpp/src/qpid/store/ms-sql/Recordset.cpp @@ -82,9 +82,13 @@ Recordset::open(DatabaseConnection* conn, const std::string& table) { _ConnectionPtr p = *conn; TESTHR(rs.CreateInstance(__uuidof(::Recordset))); + // Client-side cursors needed to get access to newly added + // identity column immediately. Recordsets need this to get the + // persistence ID for the broker objects. + rs->CursorLocation = adUseClient; rs->Open(table.c_str(), _variant_t((IDispatch *)p, true), - adOpenKeyset, + adOpenStatic, adLockOptimistic, adCmdTable); tableName = table; |