diff --git a/ChangeLog b/ChangeLog index ed5b6ab9e..bddfb7a74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-03-02 Gary Burton + * src/GrampsDbUtils/_Backup.py: Restore databases with transactions + enabled. + 2008-03-02 Gary Burton * src/GrampsCfg.py: * src/Config/_GrampsConfigKeys.py: diff --git a/src/GrampsDbUtils/_Backup.py b/src/GrampsDbUtils/_Backup.py index 8bb57aca5..481266028 100644 --- a/src/GrampsDbUtils/_Backup.py +++ b/src/GrampsDbUtils/_Backup.py @@ -167,31 +167,10 @@ def __do_restore(database): for (base, tbl) in __build_tbl_map(database): backup_name = __mk_backup_name(database, base) backup_table = open(backup_name, 'rb') - - if database.UseTXN: - __load_tbl_txn(database, backup_table, tbl) - else: - __load_tbl_no_txn(backup_table, tbl) + __load_tbl_txn(database, backup_table, tbl) database.rebuild_secondary() -def __load_tbl_no_txn(backup_table, tbl): - """ - Return the temporary backup name of the database table - - @param backup_table: file containing the backup data - @type backup_table: file - @param tbl: Berkeley db database table - @type tbl: Berkeley db database table - """ - try: - while True: - data = pickle.load(backup_table) - tbl.put(data[0], data[1], txn=None) - except EOFError: - tbl.sync() - backup_table.close() - def __load_tbl_txn(database, backup_table, tbl): """ Return the temporary backup name of the database table