From 44d5647b4b92089fc90195b41373f6b99dc5c42c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 24 Oct 2019 08:23:42 +0200 Subject: Close database as soon as possible This becomes important if we trigger a recursive implicit sync that uses the same database (e.g., in a build system module project). --- bdep/build.txx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'bdep/build.txx') diff --git a/bdep/build.txx b/bdep/build.txx index 1cd5fff..b83aa9c 100644 --- a/bdep/build.txx +++ b/bdep/build.txx @@ -45,11 +45,17 @@ namespace bdep const dir_path& prj (pp.project); - database db (open (prj, trace)); + // Load the configurations without keeping the database open longer + // than necessary. + // + configurations cfgs; + { + database db (open (prj, trace)); - transaction t (db.begin ()); - configurations cfgs (find_configurations (o, prj, t)); - t.commit (); + transaction t (db.begin ()); + cfgs = find_configurations (o, prj, t); + t.commit (); + } // If specified, verify packages are present in each configuration. // -- cgit v1.1