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

Tino Wildenhain tino at wildenhain.de
Wed Sep 8 11:56:29 EDT 2004


Hi,

Am Mi, den 08.09.2004 schrieb Chris McDonough um 17:38:
> 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?
> 
Either interface to transaction to get_transaction().abort()
or get_transaction().commit() if you need finer control 
over transactions or without any change to the zope API
just raise an exception (and catch it in standard_error_page)

Should do the trick...

Regards
Tino



More information about the ZODB-Dev mailing list