Skip to content

Commit d050635

Browse files
committed
https://telecominfraproject.atlassian.net/browse/WIFI-13172
Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
1 parent e3592b5 commit d050635

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5
1+
6

src/framework/orm.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,8 @@ namespace ORM {
576576
bool UpdateRecord(field_name_t FieldName, const T &Value, const RecordType &R) {
577577
try {
578578
assert(ValidFieldName(FieldName));
579-
580579
Poco::Data::Session Session = Pool_.get();
580+
Session.begin();
581581
Poco::Data::Statement Update(Session);
582582

583583
RecordTuple RT;
@@ -593,6 +593,7 @@ namespace ORM {
593593
Update.execute();
594594
if (Cache_)
595595
Cache_->UpdateCache(R);
596+
Session.commit();
596597
return true;
597598
} catch (const Poco::Exception &E) {
598599
Logger_.log(E);
@@ -662,6 +663,7 @@ namespace ORM {
662663
assert(ValidFieldName(FieldName));
663664

664665
Poco::Data::Session Session = Pool_.get();
666+
Session.begin();
665667
Poco::Data::Statement Delete(Session);
666668

667669
std::string St = "delete from " + TableName_ + " where " + FieldName + "=?";
@@ -671,6 +673,7 @@ namespace ORM {
671673
Delete.execute();
672674
if (Cache_)
673675
Cache_->Delete(FieldName, Value);
676+
Session.commit();
674677
return true;
675678
} catch (const Poco::Exception &E) {
676679
Logger_.log(E);
@@ -682,11 +685,13 @@ namespace ORM {
682685
try {
683686
assert(!WhereClause.empty());
684687
Poco::Data::Session Session = Pool_.get();
688+
Session.begin();
685689
Poco::Data::Statement Delete(Session);
686690

687691
std::string St = "delete from " + TableName_ + " where " + WhereClause;
688692
Delete << St;
689693
Delete.execute();
694+
Session.commit();
690695
return true;
691696
} catch (const Poco::Exception &E) {
692697
Logger_.log(E);

0 commit comments

Comments
 (0)