aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/object-statements.txx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/sqlite/object-statements.txx')
-rw-r--r--odb/sqlite/object-statements.txx13
1 files changed, 12 insertions, 1 deletions
diff --git a/odb/sqlite/object-statements.txx b/odb/sqlite/object-statements.txx
index 0ae9886..9cd8344 100644
--- a/odb/sqlite/object-statements.txx
+++ b/odb/sqlite/object-statements.txx
@@ -70,7 +70,18 @@ namespace odb
if (!delayed_.empty ())
load_delayed_ ();
- object_traits::callback (db, *l.obj, callback_event::post_load);
+ // Temporarily unlock the statement for the post_load call so that
+ // it can load objects of this type recursively. This is safe to do
+ // because we have completely loaded the current object. Also the
+ // delayed_ list is clear before the unlock and should be clear on
+ // re-lock (since a callback can only call public API functions
+ // which will make sure all the delayed loads are processed before
+ // returning).
+ //
+ {
+ auto_unlock u (*this);
+ object_traits::callback (db, *l.obj, callback_event::post_load);
+ }
g.release ();
}