From 280c36de4544fc17dc3d4f1ea168e7d2dc859129 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 18 Aug 2011 11:38:40 +0200 Subject: Fix custom recursive loading in post_load callback Before we called the callback while holding the statements locked. As a result, if the callback tried to load another object of this type, it failed. Now we unlock the statements (since we have completely loaded the object from ODB's point of view) and then call the callback. The callback test has been updated to test this situation. --- odb/relational/source.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx index 3d82863..6f80bbe 100644 --- a/odb/relational/source.hxx +++ b/odb/relational/source.hxx @@ -2326,8 +2326,8 @@ namespace relational << "init (obj, sts.image (), db);" << "load_ (sts, obj);" << "sts.load_delayed ();" - << "callback (db, obj, callback_event::post_load);" << "l.unlock ();" + << "callback (db, obj, callback_event::post_load);" << "}" << "else" << endl << "sts.delay_load (id, obj, ig.position ());" @@ -2364,8 +2364,8 @@ namespace relational << "init (obj, sts.image (), db);" << "load_ (sts, obj);" << "sts.load_delayed ();" - << "callback (db, obj, callback_event::post_load);" << "l.unlock ();" + << "callback (db, obj, callback_event::post_load);" << "}" << "else" << endl << "sts.delay_load (id, obj, ig.position ());" -- cgit v1.1