diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-04-26 16:45:23 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-04-26 16:45:23 +0200 |
commit | 33c8b712edde86572443a0200169262240d2d974 (patch) | |
tree | a13233c5af8d44d7678e3aecad05a47b6b83ed2d /odb/transaction.hxx | |
parent | 3067453a4c623c364286e7d68a446ce15e00b397 (diff) |
Add database::reset()
Diffstat (limited to 'odb/transaction.hxx')
-rw-r--r-- | odb/transaction.hxx | 15 |
1 files changed, 12 insertions, 3 deletions
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 <odb/forward.hxx> #include <odb/details/export.hxx> +#include <odb/details/unique-ptr.hxx> 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<transaction_impl> impl_; }; class LIBODB_EXPORT transaction_impl |