[ZODB-Dev] Re: [Zope-dev] Re: post publishing hook

Florent Guillaume fg at nuxeo.com
Mon Apr 4 06:02:59 EDT 2005


Jeremy Hylton wrote:
>>Is there a way to hook before the first transaction commit phase ?
> 
> If you register a synchronizer with the transaction manager, it's
> beforeCompletion() method will be called immediately before changing
> the transaction's state to committing.  This hook was intended in part
> to support use cases like "do something magic to the transaction
> before it commits."  It looks like the registerSynch() method of the
> transaction manager is undocumented, but that is an oversight.

Ok, and I see that beforeCompletion(t) has to check t.status to find out 
when it is called (if the transaction is ACTIVE it's ok, otherwise it's 
been called by abort() -- the fact that abort() calls it should probably 
be documented).

But as Julien said we'll have to find another way using ZODB 3.2...

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the ZODB-Dev mailing list