diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-08-24 13:42:04 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-08-24 13:42:04 +0200 |
commit | 7392db256c1587ff8fe87d95c5ae5c10f854f79e (patch) | |
tree | b41dd7cea27ef46e13def92af80de1d310e3c43d /odb/sqlite/transaction-impl.hxx | |
parent | 80c9352bdb197cea6a1fddc9f9e623c06e5d71ce (diff) |
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.
Diffstat (limited to 'odb/sqlite/transaction-impl.hxx')
-rw-r--r-- | odb/sqlite/transaction-impl.hxx | 10 |
1 files changed, 6 insertions, 4 deletions
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_; }; } } |