aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-08-18 11:38:40 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-08-18 11:38:40 +0200
commit280c36de4544fc17dc3d4f1ea168e7d2dc859129 (patch)
tree50511e283c3b881f35372f7f7d8f01c59a03fbcc
parente8a5c1176e88558e3aceab04c988a1c7090514b6 (diff)
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.
-rw-r--r--odb/relational/source.hxx4
1 files 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 ());"