From f1d06b7994d8b0aa31f86288183f46509bb78c19 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 30 Apr 2021 10:03:56 +0200 Subject: Add transaction::connection(database&) overload --- odb/transaction.hxx | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'odb/transaction.hxx') diff --git a/odb/transaction.hxx b/odb/transaction.hxx index 1298760..1958df3 100644 --- a/odb/transaction.hxx +++ b/odb/transaction.hxx @@ -61,9 +61,17 @@ namespace odb // Return the connection this transaction is on. // + // The second version verifies the connection is to the specified + // database. For database implementations that support attaching multiple + // databases it may also select the connection corresponding to the + // specified database. + // connection_type& connection (); + connection_type& + connection (database_type&); + bool finalized () const {return finalized_;} @@ -215,6 +223,7 @@ namespace odb class LIBODB_EXPORT transaction_impl { public: + typedef odb::tracer tracer_type; typedef odb::database database_type; typedef odb::connection connection_type; @@ -236,11 +245,14 @@ namespace odb return database_; } - connection_type& - connection () - { - return *connection_; - } + virtual connection_type& + connection (database_type*); + + virtual void + tracer (tracer_type*); + + virtual tracer_type* + tracer () const; protected: transaction_impl (database_type& db) -- cgit v1.1