summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2009-10-30 00:12:57 +0000
committerStephen D. Huston <shuston@apache.org>2009-10-30 00:12:57 +0000
commit9c0f6c9c78bb8e0c3db19d374c645127ea8899b9 (patch)
tree01dd39db7cd300c4d549af81c17e053537df0176 /qpid/cpp/src
parentfb967fea63f57d9cc9291b41b6834d2b94a7ed1f (diff)
downloadqpid-python-9c0f6c9c78bb8e0c3db19d374c645127ea8899b9.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@831167 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/store/ms-sql/BlobRecordset.cpp3
-rw-r--r--qpid/cpp/src/qpid/store/ms-sql/Recordset.cpp6
2 files changed, 7 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/store/ms-sql/BlobRecordset.cpp b/qpid/cpp/src/qpid/store/ms-sql/BlobRecordset.cpp
index 977eb6d5d2..5a5d23c797 100644
--- a/qpid/cpp/src/qpid/store/ms-sql/BlobRecordset.cpp
+++ b/qpid/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/qpid/cpp/src/qpid/store/ms-sql/Recordset.cpp b/qpid/cpp/src/qpid/store/ms-sql/Recordset.cpp
index 49232ababa..e1a5158c87 100644
--- a/qpid/cpp/src/qpid/store/ms-sql/Recordset.cpp
+++ b/qpid/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;