From 6cb673c1df081ad8648846b229b3ac2789153d9a Mon Sep 17 00:00:00 2001 From: Rodrigo Pastrana Date: Mon, 5 Feb 2024 15:44:32 -0500 Subject: [PATCH] HPCC-31181 Code Review 2 - Reverting suggested use of changeMode from read to write Signed-off-by: Rodrigo Pastrana --- esp/services/ws_store/espstorelib/daliKVStore.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/esp/services/ws_store/espstorelib/daliKVStore.cpp b/esp/services/ws_store/espstorelib/daliKVStore.cpp index d3647f5cdb2..0db602bab54 100644 --- a/esp/services/ws_store/espstorelib/daliKVStore.cpp +++ b/esp/services/ws_store/espstorelib/daliKVStore.cpp @@ -38,6 +38,11 @@ bool CDALIKVStore::createStore(const char * apptype, const char * storename, con } } + //target store does not exist, let's create it + //re-establish connection with write lock + conn.clear(); + conn.setown(querySDS().connect(DALI_KVSTORE_PATH, myProcessSession(), RTM_LOCK_WRITE, SDS_LOCK_TIMEOUT_KVSTORE)); + Owned apptree = createPTree(); apptree->setProp(DALI_KVSTORE_NAME_ATT, storename); CDateTime dt; @@ -58,8 +63,6 @@ bool CDALIKVStore::createStore(const char * apptype, const char * storename, con if (maxvalsize != 0) apptree->setPropInt(DALI_KVSTORE_MAXVALSIZE_ATT, maxvalsize); - conn->changeMode(RTM_LOCK_WRITE, SDS_LOCK_TIMEOUT_KVSTORE); - Owned root = conn->getRoot(); if (root->hasProp(xpath.str())) {