aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bpkg/database.cxx5
1 files changed, 5 insertions, 0 deletions
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)
{