server/repository.py
branchstable
changeset 6674 fd9c76196bf7
parent 6664 7b6acf314a7a
child 6722 3341521d857b
--- a/server/repository.py	Fri Nov 05 09:17:43 2010 +0100
+++ b/server/repository.py	Fri Nov 05 09:18:48 2010 +0100
@@ -1120,9 +1120,13 @@
                     rql = 'DELETE Y %s X WHERE X eid %%(x)s' % rtype
                 if scleanup:
                     # source cleaning: only delete relations stored locally
-                    rql += ', NOT Y cw_source S, S name %(source)s'
-                session.execute(rql, {'x': eid, 'source': sourceuri},
-                                build_descr=False)
+                    rql += ', NOT (Y cw_source S, S name %(source)s)'
+                try:
+                    session.execute(rql, {'x': eid, 'source': sourceuri},
+                                    build_descr=False)
+                except:
+                    self.exception('error while cascading delete for entity %s '
+                                   'from %s. RQL: %s', entity, sourceuri, rql)
         self.system_source.delete_info(session, entity, sourceuri, extid)
 
     def locate_relation_source(self, session, subject, rtype, object):