[ZODB-Dev] preventing a transaction from committing within app code

Jeremy Hylton jhylton at gmail.com
Wed Sep 8 12:20:28 EDT 2004


On Wed, 08 Sep 2004 11:38:32 -0400, Chris McDonough <chrism at plope.com> wrote:
> Is there or should there be an API within ZODB which would allow app
> code to manually mark a transaction (or a connection) as
> "uncommittable"?  I have a need for this sort of thing for a variety of
> reasons (at least I believe I do, I'd like to hear from others that also
> think they do ;-), and one way to do it is to manually insert something
> into a Connection's _conflicts dictionary (the same thing that
> Connection._is_invalidated does).  Of course that's wrong and nasty.
> Any better way?

I think that it's a bad idea to mark a transaction as uncommitable. 
Just abort it and be done with it.  The problem, then, is in the
policy of starting a new top-level transaction implicitly.  If Zope
could arrange so that new transactions were begun explicitly, then
some actions would fail with the error "no transaction active."

Jeremy


More information about the ZODB-Dev mailing list