aboutsummaryrefslogtreecommitdiff
path: root/odb/session.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-06-18 16:20:04 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-06-18 16:20:04 +0200
commita5a93dcba35e79bfa247d54991a59f389203507e (patch)
tree5432daa438a5162e24ebe225b358d72c4e5982b7 /odb/session.cxx
parentbe5d50d5e68f2dbf904378480b26495249720320 (diff)
Add argument to session ctor that indicates whether to make it current
Diffstat (limited to 'odb/session.cxx')
-rw-r--r--odb/session.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/odb/session.cxx b/odb/session.cxx
index 71c8817..3ca6af4 100644
--- a/odb/session.cxx
+++ b/odb/session.cxx
@@ -14,12 +14,15 @@ namespace odb
static ODB_TLS_POINTER (session) current_session;
session::
- session ()
+ session (bool make_current)
{
- if (has_current ())
- throw already_in_session ();
+ if (make_current)
+ {
+ if (has_current ())
+ throw already_in_session ();
- current (*this);
+ current (*this);
+ }
}
session::