[datafeed] Commit after all deletions in datafeed parser
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 18 Sep 2014 11:03:39 +0200
changeset 9975 98b4f7fa2e3a
parent 9946 ec88c1a1904a
child 9976 457efde98629
[datafeed] Commit after all deletions in datafeed parser This avoids misleading validation error because schema constraints could be temporarily broken depending on the deletion order. Closes #4372127.
server/sources/datafeed.py
--- a/server/sources/datafeed.py	Wed Sep 10 21:28:33 2014 +0200
+++ b/server/sources/datafeed.py	Thu Sep 18 11:03:39 2014 +0200
@@ -381,7 +381,7 @@
                 self.warning('delete %s %s entities', len(eids), etype)
                 cnx.execute('DELETE %s X WHERE X eid IN (%s)'
                             % (etype, ','.join(eids)))
-                cnx.commit()
+            cnx.commit()
 
     def update_if_necessary(self, entity, attrs):
         entity.complete(tuple(attrs))