[Zope-dev] [Bug] Zope's transaction behaviour flawed
Dieter Maurer
dieter@handshake.de
Mon, 3 Feb 2003 20:04:28 +0100
Jeremy Hylton wrote at 2003-2-3 10:45 -0500:
> ...
> Note that a new transaction is begin implicitly any time a persistence
> object is referenced. So the error handling code does execute in the
> context of a transaction.
I know...
> It may be that it's just not the
> transaction you'd like it to be in. I assume that some work done
> during error handling is getting committed with the next successful
> request. Yuck.
That's the problem.
> How does user-level error handling get invoked in Zope?
>From "ZPublisher.Publish".
It essentially executes the code outlined in my original post:
transaction.begin()
try:
main_action()
transaction.commit()
except:
transaction.abort()
handle_error()
There is some magic to determine "main_action"
and "handle_error" irrelevant to our current discussion.
Dieter