aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-04-25 07:34:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-04-25 07:34:35 +0200
commit3b63c05dbbd64db3ebc793cf8eb9003dacfd4cba (patch)
tree6136acdc20f66d0285d31b888f236c2c7440734b
parent9ecf8955737cfd1b1feb3421240389b439ba3759 (diff)
Add default constructor, finalized() accessor to transaction
-rw-r--r--odb/transaction.hxx8
-rw-r--r--odb/transaction.ixx9
2 files changed, 17 insertions, 0 deletions
diff --git a/odb/transaction.hxx b/odb/transaction.hxx
index e80b21d..7abb502 100644
--- a/odb/transaction.hxx
+++ b/odb/transaction.hxx
@@ -31,6 +31,11 @@ namespace odb
explicit
transaction (transaction_impl*, bool make_current = true);
+ // Create a finalized transaction instance which can later be initialized
+ // with reset().
+ //
+ transaction ();
+
// Unless the transaction has already been finalized (explicitly
// committed or rolled back), the destructor will roll it back.
//
@@ -60,6 +65,9 @@ namespace odb
connection_type&
connection ();
+ bool
+ finalized () const {return finalized_;}
+
public:
// Return true if there is a transaction in effect.
//
diff --git a/odb/transaction.ixx b/odb/transaction.ixx
index 445478b..33d107b 100644
--- a/odb/transaction.ixx
+++ b/odb/transaction.ixx
@@ -7,6 +7,15 @@
namespace odb
{
inline transaction::
+ transaction ()
+ : finalized_ (true),
+ impl_ (0),
+ free_callback_ (max_callback_count),
+ callback_count_ (0)
+ {
+ }
+
+ inline transaction::
transaction (transaction_impl* impl, bool make_current)
: finalized_ (true),
impl_ (0),