[Zope-DB] Problems with transaction management and many database adapters

Dieter Maurer dieter at handshake.de
Fri Feb 6 15:25:47 EST 2004


Federico Di Gregorio wrote at 2004-2-5 20:27 +0100:
>Il gio, 2004-02-05 alle 19:29, Dieter Maurer ha scritto:
>> I tried (in our private Zope installation) to do error handling
>> in the same transaction as the main thread (as Toby suggested).
>> But I failed due to a "get_transaction().begin()" at the begin of error
>> handling (this calls an implicite "abort").
>
>my view on the problem is that inside error handling code you can't
>count on anything. db connection? can be fsck-ed. everything can be
>fsck-ed, so an almost static page with (hidden) debug info and (visible)
>excuses to the user is more than enough. zope is doing the right thing,
>it just need to advertise its behaviour so that nobody gets bitten
>again.

Of course, I disagree:

  The current Zope behaviour is a (potentially) severe bug:

    *  It can block resources in an external database for
       an arbitrary long time
       (as the transaction is not aborted after error handling;
       the abort takes place only when this worker thread is
       used again, which may take a very long time under light load).

    *  When the worker thread is used again, it might get a different
       ZODB connection. Abortion then may affect a ZODB connection
       that is no longer open or used by a different thread.
       In the latter case, very interesting effects can take place...

-- 
Dieter



More information about the Zope-DB mailing list