From af487de69ab7f06773d3911680a199fed9d69bf7 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sat, 7 May 2016 13:46:29 -0400 Subject: [PATCH] 9441: DB-API with sqlite doesn't unlock the table when txn.batch = True --- gramps/gen/db/generic.py | 5 ----- gramps/plugins/database/dbapi.py | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/gramps/gen/db/generic.py b/gramps/gen/db/generic.py index c6c622798..2f0622d09 100644 --- a/gramps/gen/db/generic.py +++ b/gramps/gen/db/generic.py @@ -860,11 +860,6 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback): """ if transaction.batch: self.env.txn_checkpoint() - # Only build surname list after surname index is surely back - self.build_surname_list() - # FIXME: need a User GUI update callback here: - self.reindex_reference_map(lambda percent: percent) - # Reset callbacks if necessary if transaction.batch or not len(transaction): return diff --git a/gramps/plugins/database/dbapi.py b/gramps/plugins/database/dbapi.py index d8ef2332d..23deaafdb 100644 --- a/gramps/plugins/database/dbapi.py +++ b/gramps/plugins/database/dbapi.py @@ -341,6 +341,10 @@ class DBAPI(DbGeneric): """ Executed after a batch operation. """ + if txn.batch: + self.build_surname_list() + # FIXME: need a User GUI update callback here: + self.reindex_reference_map(lambda percent: percent) self.dbapi.commit() self.transaction = None msg = txn.get_description()