From e3e39be6f2d063858c92971ce8ccd89c95d4f26d Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 31 Aug 2013 23:42:57 +0100 Subject: [PATCH] serv/db: Take an excluside lock on the database We only support one server using the database at a time so take an exclusive lock and avoid later lock overhead. Signed-off-by: Richard Purdie --- lib/prserv/db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prserv/db.py b/lib/prserv/db.py index b7190bad010..3fb2c3482a7 100644 --- a/lib/prserv/db.py +++ b/lib/prserv/db.py @@ -224,7 +224,7 @@ class PRData(object): except OSError as e: if e.errno != errno.EEXIST: raise e - self.connection=sqlite3.connect(self.filename, isolation_level="DEFERRED", check_same_thread = False) + self.connection=sqlite3.connect(self.filename, isolation_level="EXCLUSIVE", check_same_thread = False) self.connection.row_factory=sqlite3.Row self._tables={} -- 2.47.3