[ZODB-Dev] API for dooming a transaction for ZODB 3.3
Steve Alexander
steve at z3u.com
Thu Jan 8 11:07:39 EST 2004
> This is probably a fair bit less useful now that MVCC is in play, but I
> believe there are still cases where you may want writes in a transaction
> to fail without preventing reads. IOW you want the transaction to fail
> only if a write is performed, but if no writing is done then everythings
> ok. At the time the transaction is "doomed" you will not need to know
> whether a write will occur further down the line or not.
>
> Assuming you call "doom()" what happens when "commit()" is subsequently
> called, an exception? I would argue yes if persistent objects have
> changed, no otherwise.
Yes, that sounds good.
> However I don't think this fulfils your use case
> to not present errors to the user.
I would want the publication component (zope 3) or the publisher (zope
2) to recognise that it has a doomed transaction, and so to ignore the
error from 'commit()'.
> I guess the alternative is to make
> "commit()" actually abort the transaction silently, but that sounds a
> bit dubious.
That sounds bad to me. Let's not do that.
> I like the name though ;^)
There's always get_transaction().wolfenstein3d() :-)
--
Steve Alexander
More information about the ZODB-Dev
mailing list