# HG changeset patch # User Alexandre Fayolle # Date 1265639298 -3600 # Node ID f1d505f979b364ac405e625276fa50c9a4ea6314 # Parent 81021d62138f32f443432938e7f44ab95306a628# Parent 1422589c35a006aa540bab5f8816d5acc123a393 merge diff -r 1422589c35a0 -r f1d505f979b3 server/hooks.py --- a/server/hooks.py Mon Feb 08 10:07:52 2010 +0100 +++ b/server/hooks.py Mon Feb 08 15:28:18 2010 +0100 @@ -58,8 +58,6 @@ if _UNIQUE_CONSTRAINTS_HOLDER is session: _UNIQUE_CONSTRAINTS_HOLDER = None _UNIQUE_CONSTRAINTS_LOCK.release() - else: - assert _UNIQUE_CONSTRAINTS_HOLDER is None def relation_deleted(session, eidfrom, rtype, eidto): diff -r 1422589c35a0 -r f1d505f979b3 server/session.py --- a/server/session.py Mon Feb 08 10:07:52 2010 +0100 +++ b/server/session.py Mon Feb 08 15:28:18 2010 +0100 @@ -461,9 +461,21 @@ self.debug('%s session %s done', trstate, self.id) except: self.exception('error while %sing', trstate) + # if error on [pre]commit: + # + # * set .failed = True on the operation causing the failure + # * call revert_event on processed operations + # * call rollback_event on *all* operations + # + # that seems more natural than not calling rollback_event + # for processed operations, and allow generic rollback + # instead of having to implements rollback, revertprecommit + # and revertcommit, that will be enough in mont case. operation.failed = True for operation in processed: operation.handle_event('revert%s_event' % trstate) + # res + self.pending_operations[:] = processed + self.pending_operations self.rollback(reset_pool) raise self.pool.commit()