aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-04-29 18:35:00 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-04-29 18:35:00 +0200
commit22d8504b99a6d7115b9353543ba138be0f3bc917 (patch)
tree9edb9b42cd0d93265163bcb259317207cd2dc224
parentc52a2921ed83051d9304601adcfdc107c06b06cb (diff)
Use new prepared_query_impl::verify_connection() in execute_query()
-rw-r--r--odb/relational/source.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/odb/relational/source.cxx b/odb/relational/source.cxx
index 20c431a..62a8b0e 100644
--- a/odb/relational/source.cxx
+++ b/odb/relational/source.cxx
@@ -4363,16 +4363,15 @@ traverse_object (type& c)
<< "static_cast<select_statement*> (pq.stmt.get ())));"
<< endl;
- os << db << "::connection& conn (" << endl
- << db << "::transaction::current ().connection ());"
+ os << db << "::transaction& tr (" << db << "::transaction::current ());"
<< endl
<< "// The connection used by the current transaction and the" << endl
<< "// one used to prepare this statement must be the same." << endl
<< "//" << endl
- << "assert (&conn == &st->connection ());"
+ << "assert (q.verify_connection (tr));"
<< endl
<< "statements_type& sts (" << endl
- << "conn.statement_cache ().find_object<object_type> ());";
+ << "st->connection ().statement_cache ().find_object<object_type> ());";
if (versioned)
os << "const schema_version_migration& svm (" <<
@@ -5662,16 +5661,15 @@ traverse_view (type& c)
<< "static_cast<select_statement*> (pq.stmt.get ())));"
<< endl;
- os << db << "::connection& conn (" << endl
- << db << "::transaction::current ().connection ());"
+ os << db << "::transaction& tr (" << db << "::transaction::current ());"
<< endl
<< "// The connection used by the current transaction and the" << endl
<< "// one used to prepare this statement must be the same." << endl
<< "//" << endl
- << "assert (&conn == &st->connection ());"
+ << "assert (q.verify_connection (tr));"
<< endl
<< "statements_type& sts (" << endl
- << "conn.statement_cache ().find_view<view_type> ());";
+ << "st->connection ().statement_cache ().find_view<view_type> ());";
if (versioned)
os << "const schema_version_migration& svm (" <<