From 7392db256c1587ff8fe87d95c5ae5c10f854f79e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 24 Aug 2011 13:42:04 +0200 Subject: Add support for transaction multiplexing Also delay getting a connection until after we do all the sanity checks (e.g., that there is no active transaction). Otherwise we are running risk of getting blocked rather than throwing an exception. --- odb/sqlite/database.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'odb/sqlite/database.cxx') diff --git a/odb/sqlite/database.cxx b/odb/sqlite/database.cxx index 6ce4621..04f788b 100644 --- a/odb/sqlite/database.cxx +++ b/odb/sqlite/database.cxx @@ -83,6 +83,24 @@ namespace odb details::options::print_usage (os); } + transaction_impl* database:: + begin () + { + return new transaction_impl (*this, transaction_impl::deferred); + } + + transaction_impl* database:: + begin_immediate () + { + return new transaction_impl (*this, transaction_impl::immediate); + } + + transaction_impl* database:: + begin_exclusive () + { + return new transaction_impl (*this, transaction_impl::exclusive); + } + odb::connection* database:: connection_ () { -- cgit v1.1