From 344fd3309516aaa7faa8d0b91511ed868a5d60a4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 29 Apr 2021 09:13:01 +0200 Subject: Move call to connection::invalidate_results() to clear() --- odb/sqlite/transaction-impl.cxx | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'odb/sqlite/transaction-impl.cxx') diff --git a/odb/sqlite/transaction-impl.cxx b/odb/sqlite/transaction-impl.cxx index 315af70..b1b83c8 100644 --- a/odb/sqlite/transaction-impl.cxx +++ b/odb/sqlite/transaction-impl.cxx @@ -95,15 +95,12 @@ namespace odb void transaction_impl:: commit () { - // Invalidate query results. + // Invalidate query results and reset active statements. // - 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. + // 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 (); @@ -121,15 +118,8 @@ namespace odb void transaction_impl:: rollback () { - // 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. + // Invalidate query results and reset active statements (the same + // reasoning as in commit()). // connection_->clear (); -- cgit v1.1