aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/transaction-impl.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-04-29 11:55:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-04-30 10:07:08 +0200
commitfa3f14db14671b4c37c400880d097b17aa12b824 (patch)
tree6b516f01505cd743c01d714329068fcd56233f73 /odb/sqlite/transaction-impl.cxx
parent2c15821eb8a9d6a7f79b7194b23d84dd8bb773c7 (diff)
Move begin/commit/rollback statements to connection
Diffstat (limited to 'odb/sqlite/transaction-impl.cxx')
-rw-r--r--odb/sqlite/transaction-impl.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/odb/sqlite/transaction-impl.cxx b/odb/sqlite/transaction-impl.cxx
index b1b83c8..721b3fe 100644
--- a/odb/sqlite/transaction-impl.cxx
+++ b/odb/sqlite/transaction-impl.cxx
@@ -6,7 +6,6 @@
#include <odb/sqlite/database.hxx>
#include <odb/sqlite/connection.hxx>
#include <odb/sqlite/statement.hxx>
-#include <odb/sqlite/statement-cache.hxx>
#include <odb/sqlite/transaction-impl.hxx>
namespace odb
@@ -43,23 +42,21 @@ namespace odb
odb::transaction_impl::connection_ = connection_.get ();
}
- statement_cache& sc (connection_->statement_cache ());
-
switch (lock_)
{
case deferred:
{
- sc.begin_statement ().execute ();
+ connection_->begin_statement ().execute ();
break;
}
case immediate:
{
- sc.begin_immediate_statement ().execute ();
+ connection_->begin_immediate_statement ().execute ();
break;
}
case exclusive:
{
- sc.begin_exclusive_statement ().execute ();
+ connection_->begin_exclusive_statement ().execute ();
break;
}
}
@@ -82,7 +79,7 @@ namespace odb
//
try
{
- c_->statement_cache ().rollback_statement ().execute ();
+ c_->rollback_statement ().execute ();
}
catch (...) {}
}
@@ -106,7 +103,7 @@ namespace odb
{
commit_guard cg (*connection_);
- connection_->statement_cache ().commit_statement ().execute ();
+ connection_->commit_statement ().execute ();
cg.release ();
}
@@ -123,7 +120,7 @@ namespace odb
//
connection_->clear ();
- connection_->statement_cache ().rollback_statement ().execute ();
+ connection_->rollback_statement ().execute ();
// Release the connection.
//