From 5b28e05df43ad9049e5a9205a1efdb216d5c2bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 22 May 2012 17:38:28 +0200 Subject: [PATCH] add transaction commits in more places --- tabellio/pcfdb/sync.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tabellio/pcfdb/sync.py b/tabellio/pcfdb/sync.py index b748e00..418ef7b 100644 --- a/tabellio/pcfdb/sync.py +++ b/tabellio/pcfdb/sync.py @@ -481,6 +481,11 @@ class SyncFromPcfDbView(BrowserView): notify(ObjectModifiedEvent(object)) self.publish(object) + if count % 100 == 0: + transaction.commit() + + + transaction.commit() previous_count = count # currently active deputies @@ -820,6 +825,9 @@ class SyncFromPcfDbView(BrowserView): else: self.unpublish(object) + # many things happened, commit + transaction.commit() + cursor.close() return count