aboutsummaryrefslogtreecommitdiff
path: root/bdep/fetch.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bdep/fetch.cxx')
-rw-r--r--bdep/fetch.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/bdep/fetch.cxx b/bdep/fetch.cxx
index 7a88106..3527e51 100644
--- a/bdep/fetch.cxx
+++ b/bdep/fetch.cxx
@@ -33,11 +33,17 @@ namespace bdep
tracer trace ("fetch");
dir_path prj (find_project (o));
- database db (open (prj, trace));
- transaction t (db.begin ());
- configurations cfgs (find_configurations (o, prj, t));
- t.commit ();
+ configurations cfgs;
+ {
+ // Don't keep the database open longer than necessary.
+ //
+ database db (open (prj, trace));
+
+ transaction t (db.begin ());
+ cfgs = find_configurations (o, prj, t);
+ t.commit ();
+ }
bool first (true);
for (const shared_ptr<configuration>& c: cfgs)