Add batch to DictionaryDB; update Query updates in batch mode

This commit is contained in:
Doug Blank 2013-12-26 16:16:57 -05:00
parent f7a367e602
commit feaf10b8c9
2 changed files with 3 additions and 3 deletions

View File

@ -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):
"""

View File

@ -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)