diff options
Diffstat (limited to 'odb/mysql/transaction-impl.cxx')
-rw-r--r-- | odb/mysql/transaction-impl.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/odb/mysql/transaction-impl.cxx b/odb/mysql/transaction-impl.cxx index 24c511f..7aa86a5 100644 --- a/odb/mysql/transaction-impl.cxx +++ b/odb/mysql/transaction-impl.cxx @@ -3,6 +3,8 @@ // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file +#include <odb/tracer.hxx> + #include <odb/mysql/mysql.hxx> #include <odb/mysql/database.hxx> #include <odb/mysql/connection.hxx> @@ -41,6 +43,12 @@ namespace odb odb::transaction_impl::connection_ = connection_.get (); } + { + odb::tracer* t; + if ((t = connection_->tracer ()) || (t = database_.tracer ())) + t->execute (*connection_, "BEGIN"); + } + if (mysql_real_query (connection_->handle (), "begin", 5) != 0) translate_error (*connection_); } @@ -50,6 +58,12 @@ namespace odb { connection_->clear (); + { + odb::tracer* t; + if ((t = connection_->tracer ()) || (t = database_.tracer ())) + t->execute (*connection_, "COMMIT"); + } + if (mysql_real_query (connection_->handle (), "commit", 6) != 0) translate_error (*connection_); @@ -63,6 +77,12 @@ namespace odb { connection_->clear (); + { + odb::tracer* t; + if ((t = connection_->tracer ()) || (t = database_.tracer ())) + t->execute (*connection_, "ROLLBACK"); + } + if (mysql_real_query (connection_->handle (), "rollback", 8) != 0) translate_error (*connection_); |