blob: 5d59c160f863c2e2619f0bfbe2e6c866fcdee0ee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
// file : odb/tracer/database.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC
// license : GNU GPL v2; see accompanying LICENSE file
#include <odb/session.hxx>
#include <odb/transaction.hxx>
#include <odb/tracer/database.hxx>
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);
}
}
}
|