diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-10-15 13:17:31 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-10-15 13:17:31 +0200 |
commit | 93cb54135cd7b214ded868d0277f2f4d5eca0e2c (patch) | |
tree | ffa41df34bace2691d383e013fdb3d3b0a9c1ccf /odb/oracle/transaction-impl.cxx | |
parent | 0051807a6c28dd0ebb425d05511fbf9127483ee1 (diff) |
Implement early connection release
Diffstat (limited to 'odb/oracle/transaction-impl.cxx')
-rw-r--r-- | odb/oracle/transaction-impl.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/odb/oracle/transaction-impl.cxx b/odb/oracle/transaction-impl.cxx index 4d42b34..e11c281 100644 --- a/odb/oracle/transaction-impl.cxx +++ b/odb/oracle/transaction-impl.cxx @@ -111,6 +111,10 @@ namespace odb void transaction_impl:: commit () { + // Invalidate query results. + // + connection_->invalidate_results (); + { odb::tracer* t; if ((t = connection_->tracer ()) || (t = database_.tracer ())) @@ -123,11 +127,19 @@ namespace odb if (s == OCI_ERROR || s == OCI_INVALID_HANDLE) translate_error (*connection_, s); + + // Release the connection. + // + connection_.reset (); } void transaction_impl:: rollback () { + // Invalidate query results. + // + connection_->invalidate_results (); + { odb::tracer* t; if ((t = connection_->tracer ()) || (t = database_.tracer ())) @@ -140,6 +152,10 @@ namespace odb if (s == OCI_ERROR || s == OCI_INVALID_HANDLE) translate_error (*connection_, s); + + // Release the connection. + // + connection_.reset (); } } } |