[dataimport] Stop swallowing errors from commit/flush
authorJulien Cristau <julien.cristau@logilab.fr>
Wed, 09 Jul 2014 16:00:21 +0200
changeset 9908 88bbb3abf30f
parent 9907 696b81eba218
child 9909 e2d42ad10f98
[dataimport] Stop swallowing errors from commit/flush Silent DB corruption is not OK. Also drop comment from ObjectStore.commit that I don't understand.
dataimport.py
--- a/dataimport.py	Wed Jul 09 15:59:34 2014 +0200
+++ b/dataimport.py	Wed Jul 09 16:00:21 2014 +0200
@@ -571,27 +571,16 @@
         return relation
 
     def commit(self):
-        """this commit method do nothing by default
-
-        This is voluntary to use the frequent autocommit feature in CubicWeb
-        when you are using hooks or another
-
-        If you want override commit method, please set it by the
-        constructor
-        """
-        pass
+        """this commit method does nothing by default"""
+        return
 
     def flush(self):
         """The method is provided so that all stores share a common API.
         It just tries to call the commit method.
         """
         print 'starting flush'
-        try:
-            self.commit()
-        except:
-            print 'failed to flush'
-        else:
-            print 'flush done'
+        self.commit()
+        print 'flush done'
 
     @property
     def nb_inserted_entities(self):