// file : odb/tracer/database.cxx // author : Boris Kolpackov // copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #include #include #include namespace odb { namespace tracer { database:: ~database () { } transaction_impl* database:: begin_transaction () { if (odb::transaction::has_current ()) throw already_in_transaction (); if (session::has_current ()) return new transaction_impl (*this, session::current ()); else return new transaction_impl (*this); } transaction_impl* database:: begin_transaction (session& s) { if (odb::transaction::has_current ()) throw already_in_transaction (); return new transaction_impl (*this, s); } } }