[Zope-DB] Question: detecting aborted transactions
dieter at handshake.de
Wed Mar 17 18:45:30 EST 2004
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).
More information about the Zope-DB