From 7391841a063328828621c8b70e02a81674686c97 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/pgsql/result.txx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'odb/pgsql/result.txx') diff --git a/odb/pgsql/result.txx b/odb/pgsql/result.txx index edea595..a0dc2f8 100644 --- a/odb/pgsql/result.txx +++ b/odb/pgsql/result.txx @@ -60,9 +60,8 @@ namespace odb object_traits::load_ (statements_, obj); statements_.load_delayed (); - object_traits::callback (db, obj, callback_event::post_load); - l.unlock (); + object_traits::callback (db, obj, callback_event::post_load); } template -- cgit v1.1