[Zope-dev] Re: Bare "except" dangerous to ZODB?

Jeremy Hylton jeremy@zope.com
20 Feb 2003 12:17:04 -0500


On Wed, 2003-02-12 at 04:23, Toby Dickenson wrote:
> On Tuesday 11 February 2003 5:21 pm, Jeremy Hylton wrote:
> > On Tue, 2003-02-11 at 12:10, Shane Hathaway wrote:
> 
> > I'd like to do the transaction states, because it would keep the code in
> > zodb3 and zodb4 similar. 
> 
> There are application-level reasons to mark a transaction as doomed, and I 
> would like to keep *that* code looking similar ;-). The transaction states 
> approach would work in that context too, right?

Here's a late answer:

If an application needs to mark a transaction as doomed, it is supposed
to call get_transaction().abort().  If a transactional resource manager,
like a database connection, needs to mark a transaction as doomed, it:

  - returns False from prepare() -- the ZODB4 spelling
  - raises an exception in tpc_vote() -- the ZODB3 spelling

Jeremy