server/session.py
changeset 4498 ee6362b4618d
parent 4490 d45cde54d464
parent 4497 593386221aa7
child 4506 5b99f4a9f8ef
--- a/server/session.py	Mon Feb 08 12:25:15 2010 +0100
+++ b/server/session.py	Mon Feb 08 13:05:19 2010 +0100
@@ -471,9 +471,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>_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()