diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-10-15 13:17:30 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-10-19 11:40:30 +0200 |
commit | 8112bd0febcfa1e3a76e0d03363facbefc3822f7 (patch) | |
tree | 0f5a05b9b29ae7d77e95f7831c214b385aaf6a3b /odb/sqlite/transaction-impl.cxx | |
parent | d94948b8bccfd8748245726487d54c41bb199baf (diff) |
Implement early connection release
Diffstat (limited to 'odb/sqlite/transaction-impl.cxx')
-rw-r--r-- | odb/sqlite/transaction-impl.cxx | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/odb/sqlite/transaction-impl.cxx b/odb/sqlite/transaction-impl.cxx index 9497c0a..1975308 100644 --- a/odb/sqlite/transaction-impl.cxx +++ b/odb/sqlite/transaction-impl.cxx @@ -67,10 +67,15 @@ 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. + // Invalidate query results. + // + connection_->invalidate_results (); + + // Reset active statements. Active statements will prevent COMMIT + // from completing (write statements) or releasing the locks (read + // statements). Normally, a statement is automatically reset on + // completion, however, if an exception is thrown, that may not + // happen. // connection_->clear (); @@ -84,9 +89,15 @@ 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. + // Invalidate query results. + // + connection_->invalidate_results (); + + // Reset active statements. Active statements will prevent ROLLBACK + // from completing (write statements) or releasing the locks (read + // statements). Normally, a statement is automatically reset on + // completion, however, if an exception is thrown, that may not + // happen. // connection_->clear (); |