diff options
Diffstat (limited to 'cpp/src')
-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; |