diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-04-30 10:03:56 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-04-30 10:37:35 +0200 |
commit | f1d06b7994d8b0aa31f86288183f46509bb78c19 (patch) | |
tree | 468b44ecedf0566fcf4c279064446d0ef661c293 /odb/transaction.hxx | |
parent | d4be234991f2a2e6abd8b2c0d585eb4ae6216979 (diff) |
Add transaction::connection(database&) overload
Diffstat (limited to 'odb/transaction.hxx')
-rw-r--r-- | odb/transaction.hxx | 22 |
1 files changed, 17 insertions, 5 deletions
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) |