summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2012-05-22 15:38:28 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2012-05-22 15:38:28 (GMT)
commit5b28e05df43ad9049e5a9205a1efdb216d5c2bdc (patch)
tree522ba69549c6f0d45ec0bc8b0314314f327bc1d7
parenta7a367231163700e5a4a29102521cb9e14d42e8c (diff)
downloadtabellio.pcfdb-5b28e05df43ad9049e5a9205a1efdb216d5c2bdc.zip
tabellio.pcfdb-5b28e05df43ad9049e5a9205a1efdb216d5c2bdc.tar.gz
tabellio.pcfdb-5b28e05df43ad9049e5a9205a1efdb216d5c2bdc.tar.bz2
add transaction commits in more places
-rw-r--r--tabellio/pcfdb/sync.py8
1 files changed, 8 insertions, 0 deletions
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