From 848eeec75dd90c2da404f223e6534c701f11fe56 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 15 Sep 2015 11:04:12 +0200 Subject: Diagnose database locking --- bpkg/database.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bpkg/database.cxx') diff --git a/bpkg/database.cxx b/bpkg/database.cxx index 3488fa1..1bfe9b9 100644 --- a/bpkg/database.cxx +++ b/bpkg/database.cxx @@ -49,11 +49,16 @@ namespace bpkg // also fail if the database is inaccessible (e.g., file does not // exist, already used by another process, etc). // + try { db.connection ()->execute ("PRAGMA locking_mode = EXCLUSIVE"); transaction t (db.begin_exclusive ()); t.commit (); } + catch (odb::timeout&) + { + fail << "configuration " << d << " is already used by another process"; + } if (create) { -- cgit v1.1