[Zope-DB] Question: detecting aborted transactions

Matthew T. Kromer matt at bane.mi.org
Wed Mar 17 21:27:46 EST 2004


A Zope request is a single transaction; one URL requested = one zope 
transaction.

jelle wrote:

>Hello,
>
>Does Zope retry all of the requests in the transaction or only the last 
>one that failed?
>
>Thanks,
>Jelle
>
>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).
>>
>>
>>    
>>
>
>  
>




More information about the Zope-DB mailing list