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

Chris McDonough chrism at plope.com
Wed Sep 8 12:35:29 EDT 2004


On Wed, 2004-09-08 at 11:56, Tino Wildenhain wrote:
> 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)

I'm specifically worried about overeager exception handlers catching
fatal errors (like Zope's Retry or ZODB's ConflictError) and thus later
a transaction getting committed that may contain inconsistent app data
state (whichever transaction it might be at the time ;-).

As a result, I'd like finer-grained control from within app code over
whether a transaction/connection will be allowed to commit.

Jeremy's idea of a "no transaction active" error at commit/abort time
after the most recent transaction has already been committed or aborted
and another transaction hasn't specifically begun would solve this
problem nicely too (and in a better way).

- C




More information about the ZODB-Dev mailing list