From 082153a229ec450afbdc68a882b34dbadae5b7ca Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Mon, 11 Dec 2023 09:47:13 -0800 Subject: [PATCH] https://telecominfraproject.atlassian.net/browse/WIFI-13147 Signed-off-by: stephb9959 --- build | 2 +- src/framework/orm.h | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build b/build index fc9afb48..2b82dfea 100644 --- a/build +++ b/build @@ -1 +1 @@ -59 \ No newline at end of file +60 \ No newline at end of file diff --git a/src/framework/orm.h b/src/framework/orm.h index 9e83540f..c0be1373 100644 --- a/src/framework/orm.h +++ b/src/framework/orm.h @@ -576,8 +576,8 @@ namespace ORM { bool UpdateRecord(field_name_t FieldName, const T &Value, const RecordType &R) { try { assert(ValidFieldName(FieldName)); - Poco::Data::Session Session = Pool_.get(); + Session.begin(); Poco::Data::Statement Update(Session); RecordTuple RT; @@ -593,6 +593,7 @@ namespace ORM { Update.execute(); if (Cache_) Cache_->UpdateCache(R); + Session.commit(); return true; } catch (const Poco::Exception &E) { Logger_.log(E); @@ -662,6 +663,7 @@ namespace ORM { assert(ValidFieldName(FieldName)); Poco::Data::Session Session = Pool_.get(); + Session.begin(); Poco::Data::Statement Delete(Session); std::string St = "delete from " + TableName_ + " where " + FieldName + "=?"; @@ -671,6 +673,7 @@ namespace ORM { Delete.execute(); if (Cache_) Cache_->Delete(FieldName, Value); + Session.commit(); return true; } catch (const Poco::Exception &E) { Logger_.log(E); @@ -682,11 +685,13 @@ namespace ORM { try { assert(!WhereClause.empty()); Poco::Data::Session Session = Pool_.get(); + Session.begin(); Poco::Data::Statement Delete(Session); std::string St = "delete from " + TableName_ + " where " + WhereClause; Delete << St; Delete.execute(); + Session.commit(); return true; } catch (const Poco::Exception &E) { Logger_.log(E);