diff options
author | randomdan <randomdan@localhost> | 2013-12-08 15:54:52 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2013-12-08 15:54:52 +0000 |
commit | f760212202c5332934a3e3f2df06313245fc22ad (patch) | |
tree | 25a2cceaf112a01b9288b40f275f84acb9e1ff38 | |
parent | Change signal handling to be more helpful and proper (diff) | |
download | project2-f760212202c5332934a3e3f2df06313245fc22ad.tar.bz2 project2-f760212202c5332934a3e3f2df06313245fc22ad.tar.xz project2-f760212202c5332934a3e3f2df06313245fc22ad.zip |
Add savepoint support to core DB connector
Add a savepoint wrapper around sql merge
-rw-r--r-- | project2/sql/sqlMergeTask.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/project2/sql/sqlMergeTask.cpp b/project2/sql/sqlMergeTask.cpp index d4e22c7..4356279 100644 --- a/project2/sql/sqlMergeTask.cpp +++ b/project2/sql/sqlMergeTask.cpp @@ -6,6 +6,7 @@ #include "exceptions.h" #include "sqlVariableBinder.h" #include "scriptLoader.h" +#include "scopeObject.h" #include <misc.h> #include <stdio.h> #include <stdexcept> @@ -161,6 +162,11 @@ class MergeWhere : public TablePatch::WhereProvider { void SqlMergeTask::execute(ExecContext * ec) const { + auto savepoint(stringf("sqlmerge_savepoint_%p", this)); + destdb->savepoint(savepoint); + ScopeObject SPHandler(NULL, + boost::bind(&DB::Connection::releaseSavepoint, destdb, savepoint), + boost::bind(&DB::Connection::rollbackToSavepoint, destdb, savepoint)); createTempTable(); if (earlyKeys(NULL)) { createTempKey(); |