[ZODB-Dev] API for dooming a transaction for ZODB 3.3

Dieter Maurer dieter at handshake.de
Sat Jan 10 14:18:08 EST 2004


Steve Alexander wrote at 2004-1-10 10:30 +0200:
> ...
>> Dooming a transactions is a very disruptive global (with respect
>> to the request) operation -- especially when used inside a module.
>> 
>> It may affect things far outside the scope of the dooming.
>
>I don't see how it can change things outside the scope of the dooming.
>It ensures the current transaction cannot be committed. The whole point
>of transactions is that anything important within their scope either
>happens or does not happen depending on whether the transaction commits
>or not. The scope of the dooming is the scope of the transaction.

Yes, but usually operations in a transaction have a purpose.
I do not think it is a good idea to "undo" operations
without a clear indication that they have not been performed.

The scoping issue does not relate to transaction but to
module boundaries. Say, your request contains functions
from two independent "modules". One of them uses dooming,
the other expects that when its locally successful
operation should fail for some non local reasons there must
be a clear error indication (say some account management -- if the
account transaction does not occur for any reason, you must
learn about this). When dooming looks like success (which may
be adequate in some contexts), it does not merge well in all
applications.

>> Why can you not raise a special exception that you can handle
>> in a special way inside your error page?
>
>That's a Zope issue, not a ZODB issue.

But you can make your ZODB application behave similar...

>I'd like to focus on getting a 'dooming' API into the ZODB.
>
>If this API were in the ZODB tomorrow, and with no further changes to
>Zope, calling doom() works just like having a conflict error that is
>caught and does not reach the publisher. The request will continue to be
>processed as normal, but when the publisher tries to commit, a conflict
>error will be raised.

A "ConflictError" usually leads to a retry. When sufficiently many
retries fail, you get an error indication.

If you want to get this with "dooming", I do not have much objections.

-- 
Dieter



More information about the ZODB-Dev mailing list