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/transaction-impl.hxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'odb/sqlite/transaction-impl.hxx') diff --git a/odb/sqlite/transaction-impl.hxx b/odb/sqlite/transaction-impl.hxx index 8b5687b..f0df824 100644 --- a/odb/sqlite/transaction-impl.hxx +++ b/odb/sqlite/transaction-impl.hxx @@ -21,10 +21,7 @@ namespace odb { class LIBODB_SQLITE_EXPORT transaction_impl: public odb::transaction_impl { - protected: - friend class connection; - friend class transaction; - + public: typedef sqlite::database database_type; typedef sqlite::connection connection_type; @@ -35,12 +32,16 @@ namespace odb exclusive }; + transaction_impl (database_type&, lock); transaction_impl (connection_ptr, lock); virtual ~transaction_impl (); virtual void + start (); + + virtual void commit (); virtual void @@ -51,6 +52,7 @@ namespace odb private: connection_ptr connection_; + lock lock_; }; } } -- cgit v1.1