[ZCM] [ZC] 786/ 2 Comment "Session gets munged"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin@zope.org
Sun, 02 Feb 2003 05:05:32 -0500


Issue #786 Update (Comment) "Session gets munged"
 Status Pending, Zope/bug medium
To followup, visit:
  http://collector.zope.org/Zope/786

==============================================================
= Comment - Entry #2 by stevea on Feb 2, 2003 5:05 am

An error handler should never be allowed to commit the transaction that an exception was raised in. An exception punches through the various frames in the stack, and the error handler has no way of knowing what state may have been left inconsistent.
________________________________________
= Request - Entry #1 by Anonymous User on Jan 31, 2003 4:52 pm

Publish.py does an abort(freeme=1) upon catching an exception.  It then calls the registered error handlers (e.g., resolves to standard_error_message).  if the SESSION is referenced (even read only) within this error handler, there is a high probability that the session data structures (index[] and data[]) will get messed up.

This seems to be a direct result of traversing persistent objects outside the context of any Transaction.

I feel that Publish.py should only abort(freeme=1) AFTER any error handler is called.  The error handler is would then be free to commit() if it feels it has fixed the problem, or do nothing to let Zope abort().
==============================================================