Hi all,

The ExtFile product I maintain keeps its payload on the filesystem. All operations are performed using temporary files which are then saved or deleted on transaction commit or abort respectively.

To this end an ExtFile provides _finish and _abort methods which are hooked up to a TM. Since Zope 2.8 (MVCC) I have a problem with aborts. On abort the machinery apparently nukes an ExtFile's persistent attributes, and I lose all information I need to clean up the external resources (filename, path, etc).

What I need is a way to guarantee my cleanup code is called *before* the persistent part of my object vanishes. I currently manipulate the transaction's _resources list directly [1], but that's obviously not desirable. I have seen synchronizers, but I am unable to tell whether a beforeCompletion will end up to be a commit or abort.

We now have before-commit hooks, and it seems what I need is a before- abort hook as well.

Thoughts appreciated,


[1] http://dev.plone.org/collective/browser/ExtFile/trunk/TM.py

Anything that happens, happens.  --Douglas Adams

For more information about ZODB, see the ZODB Wiki:

ZODB-Dev mailing list  -  ZODB-Dev@zope.org

Reply via email to