2007-06-14 Don Allingham <don@gramps-project.org>

* src/GrampsDbUtils/_Backup.py (__do_restore): use transactions during restore



svn: r8554
This commit is contained in:
Don Allingham 2007-06-15 04:35:59 +00:00
parent eb5135310f
commit 2caf3dd35a
2 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,6 @@
2007-06-14 Don Allingham <don@gramps-project.org>
* src/GrampsDbUtils/_Backup.py (__do_restore): use transactions during restore
2007-06-14 Brian Matherly <brian@gramps-project.org>
* src/docgen/SvgDrawDoc.py: improve text rendering (#0001072)

View File

@ -125,9 +125,19 @@ def __do_restore(database):
try:
while True:
data = pickle.load(backup_table)
tbl[data[0]] = data[1]
if database.UseTXN:
txn = database.env.txn_begin()
else:
txn = None
tbl.put(data[0], data[1], txn=txn)
if txn:
txn.commit()
except EOFError:
if not database.UseTXN:
tbl.sync()
backup_table.close()
database.rebuild_secondary()
def __build_tbl_map(database):