From a5a93dcba35e79bfa247d54991a59f389203507e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 18 Jun 2012 16:20:04 +0200 Subject: Add argument to session ctor that indicates whether to make it current --- odb/session.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'odb/session.cxx') 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:: -- cgit v1.1