@@ -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