diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-08-21 16:27:34 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-08-21 16:27:34 +0200 |
commit | bde4f5c3bddb437c5238bcb6dd2311bc57600ef1 (patch) | |
tree | e25658cc26cf40318847c60e8de01ac1720bd18a /odb/tracer/transaction-impl.cxx | |
parent | 4c78c4b1e1a826a85468a4125813cec3dcbbbd06 (diff) |
Add odb::connection class
This abstract class represents a connection to the database. One can
use it to start a transaction or to execute a native statement out
of a transaction.
Before we had concrete connection classes in the database runtime
libraries (e.g., odb::mysql::connection). Now these classes derive
from odb::connection.
Diffstat (limited to 'odb/tracer/transaction-impl.cxx')
-rw-r--r-- | odb/tracer/transaction-impl.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/odb/tracer/transaction-impl.cxx b/odb/tracer/transaction-impl.cxx index f8b90af..2069568 100644 --- a/odb/tracer/transaction-impl.cxx +++ b/odb/tracer/transaction-impl.cxx @@ -6,6 +6,7 @@ #include <iostream> #include <odb/tracer/database.hxx> +#include <odb/tracer/connection.hxx> #include <odb/tracer/transaction-impl.hxx> using std::cout; @@ -16,8 +17,10 @@ namespace odb namespace tracer { transaction_impl:: - transaction_impl (database_type& db) - : odb::transaction_impl (db), finalized_ (false) + transaction_impl (connection_ptr c) + : odb::transaction_impl (c->database (), *c), + finalized_ (false), + connection_ (c) { cout << "begin transaction" << endl; } |