summaryrefslogtreecommitdiff
path: root/odb/relational/source.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-03-30 15:50:44 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-03-30 15:50:44 +0200
commit8c0ee3ba2db18ba759a5be502a89d31f3288d32e (patch)
treebf30e99ecab54acba00426bf664a1726ea8db70f /odb/relational/source.hxx
parent9d290dc880bd27a231de9c02c62e25369dc452a4 (diff)
Assert that statements are not already locked in top-level calls
This can be violated with crafty callbacks.
Diffstat (limited to 'odb/relational/source.hxx')
-rw-r--r--odb/relational/source.hxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx
index eae49a5..ce031b1 100644
--- a/odb/relational/source.hxx
+++ b/odb/relational/source.hxx
@@ -2906,6 +2906,7 @@ namespace relational
// This can only be top-level call so lock must succeed.
//
os << r_tr << "::statements_type::auto_lock l (sts);"
+ << "assert (l.locked ()) /* Must be a top-level call. */;"
<< endl
<< r_tr << "::id_image_type& i (sts.id_image ());"
<< r_tr << "::init (i, " << id << ");"