aboutsummaryrefslogtreecommitdiff
path: root/odb/transaction.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/transaction.cxx')
-rw-r--r--odb/transaction.cxx27
1 files changed, 24 insertions, 3 deletions
diff --git a/odb/transaction.cxx b/odb/transaction.cxx
index 6002783..f75cf32 100644
--- a/odb/transaction.cxx
+++ b/odb/transaction.cxx
@@ -1,5 +1,4 @@
// file : odb/transaction.cxx
-// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC
// license : GNU GPL v2; see accompanying LICENSE file
#include <odb/transaction.hxx>
@@ -95,7 +94,7 @@ namespace odb
finalized_ = true;
rollback_guard rg (*this);
- impl_->connection ().transaction_tracer_ = 0;
+ impl_->tracer (0);
if (tls_get (current_transaction) == this)
{
@@ -119,7 +118,7 @@ namespace odb
finalized_ = true;
rollback_guard rg (*this);
- impl_->connection ().transaction_tracer_ = 0;
+ impl_->tracer (0);
if (tls_get (current_transaction) == this)
{
@@ -332,4 +331,26 @@ namespace odb
~transaction_impl ()
{
}
+
+ connection& transaction_impl::
+ connection (database_type* db)
+ {
+ assert (db == 0 || db == &database_);
+ return *connection_;
+ }
+
+ // The transaction-specific tracer is stored in the connection. See the
+ // connection class for the reason.
+ //
+ void transaction_impl::
+ tracer (tracer_type* t)
+ {
+ connection_->transaction_tracer_ = t;
+ }
+
+ tracer* transaction_impl::
+ tracer () const
+ {
+ return connection_->transaction_tracer_;
+ }
}