diff options
Diffstat (limited to 'odb/tracer/database.cxx')
-rw-r--r-- | odb/tracer/database.cxx | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/odb/tracer/database.cxx b/odb/tracer/database.cxx index 1359a26..90cfdfd 100644 --- a/odb/tracer/database.cxx +++ b/odb/tracer/database.cxx @@ -3,8 +3,8 @@ // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file -#include <odb/transaction.hxx> #include <odb/tracer/database.hxx> +#include <odb/tracer/connection.hxx> namespace odb { @@ -15,19 +15,26 @@ namespace odb { } - unsigned long long database:: - execute (const char*, std::size_t) + transaction_impl* database:: + begin () { - return 0; + return connection ()->begin (); } - transaction_impl* database:: - begin () + inline connection_ptr database:: + connection () { - if (odb::transaction::has_current ()) - throw already_in_transaction (); + // Go through the virtual connection_() function instead of + // directly to allow overriding. + // + return connection_ptr ( + static_cast<tracer::connection*> (connection_ ())); + } - return new transaction_impl (*this); + odb::connection* database:: + connection_ () + { + return new (details::shared) connection_type (*this); } } } |