[Zope-DB] Question: detecting aborted transactions

jelle jellej at pacbell.net
Wed Mar 17 20:28:51 EST 2004


Does Zope retry all of the requests in the transaction or only the last 
one that failed?


On Thu, 18 Mar 2004, Dieter Maurer wrote:

> jelle wrote at 2004-3-16 11:55 -0800:
> > ...
> >Under high load, Postgresql 
> >occasionally aborts a statement with the message "could not serialize 
> >access due to concurrent update" which causes the Zope mechanism to 
> >silently rollback the transaction.
> Zope does not do that!
> Postgres aborted the transaction and not silently, as it told you
> that it is unable to fulfill the promisses associated
> with a transaction.
> The best thing would be that the "ZPsycopgDA" turns this
> problem into a "ConflictError". New versions may do this
> already (I proposed such a change to the author).
> You must *NOT* catch the exception raised by the Z SQL Method!
> If you do, you prevent Zope from aborting its own transaction.
> This is necessary because all subsequent Postgre SQL statements
> will have no effect (as Postgres already aborted the transaction).
> Zope must abort its transaction too.
> When the problem is mapped to "ConflictError", Zope
> will automatically retry the request (up to 3 times).


 We live in the era of asymptotic prophecy: The truth, which 
 we'll never arrive at, would make us something like free.
   -S. Klawans

More information about the Zope-DB mailing list