aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/mysql/statement.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/odb/mysql/statement.cxx b/odb/mysql/statement.cxx
index 3e0deb8..f5379d6 100644
--- a/odb/mysql/statement.cxx
+++ b/odb/mysql/statement.cxx
@@ -69,6 +69,9 @@ namespace odb
image_version_ (0),
parameters_ (parameters)
{
+ if (statement* a = conn_.active ())
+ a->cancel ();
+
if (mysql_stmt_prepare (stmt_, s.c_str (), s.size ()) != 0)
throw database_exception (stmt_);
}
@@ -210,6 +213,9 @@ namespace odb
persist_statement (connection& conn, const string& s, binding& image)
: statement (conn), image_ (image), version_ (0)
{
+ if (statement* a = conn_.active ())
+ a->cancel ();
+
if (mysql_stmt_prepare (stmt_, s.c_str (), s.size ()) != 0)
throw database_exception (stmt_);
}
@@ -280,6 +286,9 @@ namespace odb
image_ (image),
image_version_ (0)
{
+ if (statement* a = conn_.active ())
+ a->cancel ();
+
if (mysql_stmt_prepare (stmt_, s.c_str (), s.size ()) != 0)
throw database_exception (stmt_);
}
@@ -398,6 +407,9 @@ namespace odb
image_ (image),
image_version_ (0)
{
+ if (statement* a = conn_.active ())
+ a->cancel ();
+
if (mysql_stmt_prepare (stmt_, s.c_str (), s.size ()) != 0)
throw database_exception (stmt_);
}
@@ -456,6 +468,9 @@ namespace odb
erase_statement (connection& conn, const string& s, binding& id)
: statement (conn), id_ (id), version_ (0)
{
+ if (statement* a = conn_.active ())
+ a->cancel ();
+
if (mysql_stmt_prepare (stmt_, s.c_str (), s.size ()) != 0)
throw database_exception (stmt_);
}