From c7bbc01b2089dce3f0eed6cb9b6be6936cbfdeae Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sat, 21 Jan 2017 20:52:48 +0000 Subject: [PATCH] Create the schema within a transaction --- gramps/plugins/db/dbapi/dbapi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gramps/plugins/db/dbapi/dbapi.py b/gramps/plugins/db/dbapi/dbapi.py index 571c5c27e..cac044184 100644 --- a/gramps/plugins/db/dbapi/dbapi.py +++ b/gramps/plugins/db/dbapi/dbapi.py @@ -128,6 +128,8 @@ class DBAPI(DbGeneric): """ Create and update schema. """ + self.dbapi.begin() + # make sure schema is up to date: self.dbapi.execute('CREATE TABLE person ' '(' @@ -261,6 +263,7 @@ class DBAPI(DbGeneric): self.dbapi.execute('CREATE INDEX reference_obj_handle ' 'ON reference(obj_handle)') + self.dbapi.commit() def _close(self): self.dbapi.close()