From 338ef7bb173561b186b183bfa898cf978b5ac200 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 30 Dec 2015 02:35:04 +0000 Subject: Use TransactionScope instead of ScopeObject --- libdbpp/tablepatch.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/libdbpp/tablepatch.cpp b/libdbpp/tablepatch.cpp index 114a2b4..f902739 100644 --- a/libdbpp/tablepatch.cpp +++ b/libdbpp/tablepatch.cpp @@ -5,7 +5,6 @@ #include "sqlWriter.h" #include #include -#include #include DB::TablePatch::TablePatch() : @@ -24,12 +23,7 @@ DB::Connection::patchTable(TablePatch * tp) if (!inTx()) { throw TransactionRequired(); } - auto savepointName = stringbf("TablePatch_%p_%d", tp, getpid()); - savepoint(savepointName); - AdHoc::ScopeExit _(AdHoc::ScopeExit::Event(), - [this, savepointName](){ releaseSavepoint(savepointName); }, - [this, savepointName](){ rollbackToSavepoint(savepointName); } - ); + TransactionScope tx(this); return { patchDeletes(tp), patchUpdates(tp), -- cgit v1.2.3