aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/transaction-impl.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-03-24 14:02:16 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-03-24 14:02:16 +0200
commit7939f7972cf22ee9a74518978e4f7d4d77535e09 (patch)
treeb211e2f455ef717482370fc262a63a5f7bfeb77f /odb/sqlite/transaction-impl.cxx
parent01e70d9a1d49bcb126adc45f85168aa7c9cbad19 (diff)
Add support for clearing connection from active and uncached statements
Diffstat (limited to 'odb/sqlite/transaction-impl.cxx')
-rw-r--r--odb/sqlite/transaction-impl.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/odb/sqlite/transaction-impl.cxx b/odb/sqlite/transaction-impl.cxx
index 3730100..36d6c2b 100644
--- a/odb/sqlite/transaction-impl.cxx
+++ b/odb/sqlite/transaction-impl.cxx
@@ -28,6 +28,13 @@ namespace odb
void transaction_impl::
commit ()
{
+ // Reset active and finilize uncached statements. Active statements
+ // will prevent COMMIT from completing (write statements) or releasing
+ // the locks (read statements). Finilization of uncached statements is
+ // needed to release the connection.
+ //
+ connection_->clear ();
+
connection_->statement_cache ().commit_statement ().execute ();
// Release the connection.
@@ -38,6 +45,12 @@ namespace odb
void transaction_impl::
rollback ()
{
+ // Reset active and finilize uncached statements. Active statements
+ // will prevent ROLLBACK from completing. Finilization of uncached
+ // statements is needed to release the connection.
+ //
+ connection_->clear ();
+
connection_->statement_cache ().rollback_statement ().execute ();
// Release the connection.