From 80161b57e3769bb79ae72e01c1e8bc9d8ad9fb96 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 8 Mar 2006 17:33:07 +0000 Subject: [PATCH] make txn optional svn: r6103 --- src/GrampsDb/_GrampsBSDDB.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/GrampsDb/_GrampsBSDDB.py b/src/GrampsDb/_GrampsBSDDB.py index f689dd5de..9a338b6a2 100644 --- a/src/GrampsDb/_GrampsBSDDB.py +++ b/src/GrampsDb/_GrampsBSDDB.py @@ -683,6 +683,8 @@ class GrampsBSDDB(GrampsDbBase): old_data = self.reference_map.get(str(key),txn=self.txn) transaction.add(REFERENCE_KEY,str(key),old_data,None) transaction.reference_del.append(str(key)) + if not self.UseTXN: + self.reference_map.sync() def _add_reference(self,key,data,transaction,txn=None): """ @@ -700,6 +702,8 @@ class GrampsBSDDB(GrampsDbBase): else: transaction.add(REFERENCE_KEY,str(key),None,data) transaction.reference_add.append((str(key),data)) + if not self.UseTXN: + self.reference_map.sync() def reindex_reference_map(self): """Reindex all primary records in the database. This will be a @@ -942,6 +946,8 @@ class GrampsBSDDB(GrampsDbBase): the_txn = None self._update_reference_map(obj,transaction,txn=the_txn) data_map.put(handle,obj.serialize(),txn=the_txn) + if not self.UseTXN: + data_map.sync() if the_txn: the_txn.commit() old_data = None @@ -949,6 +955,8 @@ class GrampsBSDDB(GrampsDbBase): self._update_reference_map(obj,transaction) old_data = data_map.get(handle,txn=self.txn) new_data = obj.serialize() + if not self.UseTXN: + data_map.sync() transaction.add(key,handle,old_data,new_data) if old_data: update_list.append((handle,new_data))