From feaf10b8c9967f84340c93dc5c8cb6ed5957ec6d Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Thu, 26 Dec 2013 16:16:57 -0500 Subject: [PATCH] Add batch to DictionaryDB; update Query updates in batch mode --- gramps/gen/db/dictionary.py | 4 ++-- gramps/gen/merge/diff.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gramps/gen/db/dictionary.py b/gramps/gen/db/dictionary.py index 3b7b96050..1ca0be15e 100644 --- a/gramps/gen/db/dictionary.py +++ b/gramps/gen/db/dictionary.py @@ -88,8 +88,8 @@ class Bookmarks: pass class DictionaryTxn(DbTxn): - def __init__(self, message, db): - DbTxn.__init__(self, message, db) + def __init__(self, message, db, batch=False): + DbTxn.__init__(self, message, db, batch) def get(self, key, default=None, txn=None, **kwargs): """ diff --git a/gramps/gen/merge/diff.py b/gramps/gen/merge/diff.py index 8bab0a5d9..e64fd55e3 100644 --- a/gramps/gen/merge/diff.py +++ b/gramps/gen/merge/diff.py @@ -525,7 +525,7 @@ class Struct(object): def update_db(self, trans=None): if self.db: if trans is None: - with self.transaction("Struct Update", self.db) as trans: + with self.transaction("Struct Update", self.db, batch=True) as trans: new_obj = from_struct(self.struct) name, handle = self.struct["_class"], self.struct["handle"] old_obj = self.db.get_from_name_and_handle(name, handle)