aboutsummaryrefslogtreecommitdiff
path: root/odb/session.cxx
diff options
context:
space:
mode:
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::