From 2d592fa521424635ec37798d363327fc42cc20fa Mon Sep 17 00:00:00 2001 From: prculley Date: Sat, 29 Jul 2017 21:03:17 +0100 Subject: [PATCH] Prevent dbapi from nesting transactions for metadata Fixes #10038. --- gramps/plugins/db/dbapi/dbapi.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gramps/plugins/db/dbapi/dbapi.py b/gramps/plugins/db/dbapi/dbapi.py index 4fbc195f8..d67147a92 100644 --- a/gramps/plugins/db/dbapi/dbapi.py +++ b/gramps/plugins/db/dbapi/dbapi.py @@ -224,23 +224,26 @@ class DBAPI(DbGeneric): Lowlevel interface to the backend transaction. Executes a db BEGIN; """ - _LOG.debug(" DBAPI %s transaction begin", hex(id(self))) - self.dbapi.begin() + if self.transaction == None: + _LOG.debug(" DBAPI %s transaction begin", hex(id(self))) + self.dbapi.begin() def _txn_commit(self): """ Lowlevel interface to the backend transaction. Executes a db END; """ - _LOG.debug(" DBAPI %s transaction commit", hex(id(self))) - self.dbapi.commit() + if self.transaction == None: + _LOG.debug(" DBAPI %s transaction commit", hex(id(self))) + self.dbapi.commit() def _txn_abort(self): """ Lowlevel interface to the backend transaction. Executes a db ROLLBACK; """ - self.dbapi.rollback() + if self.transaction == None: + self.dbapi.rollback() def transaction_begin(self, transaction): """