# HG changeset patch # User Sylvain Thénault # Date 1288945128 -3600 # Node ID fd9c76196bf7ab08bd8a8175c98523224c95d79b # Parent 5eb2f1f2c277f98b97e0741fe848f12544b5c9ff [repository] don't crash when cascading delete a relation, this may let the database in an inconsistent state anyway, so simply log the error diff -r 5eb2f1f2c277 -r fd9c76196bf7 server/repository.py --- 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):