aboutsummaryrefslogtreecommitdiff
path: root/bdep/publish.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-10-24 08:23:42 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-10-24 08:23:42 +0200
commit44d5647b4b92089fc90195b41373f6b99dc5c42c (patch)
tree8b11ace1051875e9d7ffe910885ca2790f2d1ca1 /bdep/publish.cxx
parent282361b57f66b59a50ed3d073b46c7189c9553ee (diff)
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).
Diffstat (limited to 'bdep/publish.cxx')
-rw-r--r--bdep/publish.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/bdep/publish.cxx b/bdep/publish.cxx
index 1fcc942..ab58025 100644
--- a/bdep/publish.cxx
+++ b/bdep/publish.cxx
@@ -807,12 +807,15 @@ namespace bdep
true /* load_packages */));
const dir_path& prj (pp.project);
- database db (open (prj, trace));
// We need a single configuration to prepare package distribution.
//
shared_ptr<configuration> cfg;
{
+ // Don't keep the database open longer than necessary.
+ //
+ database db (open (prj, trace));
+
transaction t (db.begin ());
configurations cfgs (find_configurations (o, prj, t));
t.commit ();