diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-11-07 15:00:07 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-11-08 16:03:17 +0200 |
commit | 1d664d31bdfc341ca642948efdf395e7922141f6 (patch) | |
tree | 73bb369f5072aee7daf621d0cc009731178bf581 /odb/oracle/transaction-impl.cxx | |
parent | 487bd012de7efc7237581b4a7aeac7fd817138fb (diff) |
Add support for SQL statement tracing
Diffstat (limited to 'odb/oracle/transaction-impl.cxx')
-rw-r--r-- | odb/oracle/transaction-impl.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/odb/oracle/transaction-impl.cxx b/odb/oracle/transaction-impl.cxx index 4751366..e46aac1 100644 --- a/odb/oracle/transaction-impl.cxx +++ b/odb/oracle/transaction-impl.cxx @@ -7,6 +7,8 @@ #include <oci.h> +#include <odb/tracer.hxx> + #include <odb/oracle/database.hxx> #include <odb/oracle/connection.hxx> #include <odb/oracle/error.hxx> @@ -89,6 +91,12 @@ namespace odb auto_t.release (); } + { + odb::tracer* t; + if ((t = connection_->tracer ()) || (t = database_.tracer ())) + t->execute (*connection_, "BEGIN"); + } + // We never use OCITransDetach so the timeout parameter is // of no consequence. // @@ -104,6 +112,12 @@ namespace odb void transaction_impl:: commit () { + { + odb::tracer* t; + if ((t = connection_->tracer ()) || (t = database_.tracer ())) + t->execute (*connection_, "COMMIT"); + } + sword s (OCITransCommit (connection_->handle (), connection_->error_handle (), OCI_DEFAULT)); @@ -115,6 +129,12 @@ namespace odb void transaction_impl:: rollback () { + { + odb::tracer* t; + if ((t = connection_->tracer ()) || (t = database_.tracer ())) + t->execute (*connection_, "ROLLBACK"); + } + sword s (OCITransRollback (connection_->handle (), connection_->error_handle (), OCI_DEFAULT)); |