From 33c8b712edde86572443a0200169262240d2d974 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 26 Apr 2012 16:45:23 +0200 Subject: Add database::reset() --- odb/transaction.hxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'odb/transaction.hxx') diff --git a/odb/transaction.hxx b/odb/transaction.hxx index 8c00508..e75cddd 100644 --- a/odb/transaction.hxx +++ b/odb/transaction.hxx @@ -10,6 +10,7 @@ #include #include +#include namespace odb { @@ -21,8 +22,8 @@ namespace odb typedef odb::database database_type; typedef odb::connection connection_type; - // If the second argument is false, then this transaction is not - // made the current transaction of the thread. + // If the second argument is false, then this transaction is not made + // the current transaction of the thread. // explicit transaction (transaction_impl*, bool make_current = true); @@ -32,6 +33,14 @@ namespace odb // ~transaction (); + // Unless the current transaction has already been finalized (explicitly + // committed or rolled back), reset will roll it back. If the second + // argument is false, then this transaction is not made the current + // transaction of the thread. + // + void + reset (transaction_impl*, bool make_current = true); + void commit (); @@ -96,7 +105,7 @@ namespace odb protected: bool finalized_; - transaction_impl* impl_; + details::unique_ptr impl_; }; class LIBODB_EXPORT transaction_impl -- cgit v1.1