[Zope-dev] [Bug] Zope's transaction behaviour flawed
Dieter Maurer
dieter@handshake.de
Mon, 3 Feb 2003 20:12:52 +0100
Toby Dickenson wrote at 2003-2-3 17:04 +0000:
> On Sunday 02 February 2003 3:40 pm, Dieter Maurer wrote:
> > Zope's current transaction behaviour is essentially:
> >
> > 1 ## request starts
> > 2 transaction.begin()
> > 3 try:
> > 4 object= REQUEST.traverse(...)
> > 5 mapply(object,...)
> > 6 transaction.commit()
> > 7 except:
> > 8 transaction.abort()
> > 9 handle_error()
> > 10 ## request ends
> >
> >
> > This is flawed as error handling is done outside of a transaction.
> >
> > Potential changes during the error handling spill over
> > uncontrolled into another request and are there
> > either committed or aborted as part of this request.
> ...
>
> and I
> think
> there is a flaw in this explanation. Surely any changes that leak out fro
> m
> one request will will be be aborted before they can do any damage, during
> the
> call to transaction.begin() on line 2.
>
> The doc string from transaction.begin is:
>
> '''Begin a new transaction.
>
> This aborts any transaction in progres.
> '''
>
> (I should have a chance to experiment with this tomorrow)
Then, we must find another explanation for Andrews observation:
He observed heavily inconsistent (Zope) session data
when he accessed the session during error handling.
The problem went away when he did not do that.
@Andrew:
Can you check your log files whether
the events would be consistent with rollbacks at the start
of the next request.
Dieter