Jürgen Herrmann wrote:
i'm trying to form a patch that will result in a method "_before_commit()"
being called on each modified object in a transaction (if that method
exists of course) right before commit.
main sense is to automate/delay (re)cataloging.
first i looked at the Transaction class, as there have been heavy
modifications to it from zodb 3.2 to 3.4
Patching is generally a bad idea.
I suggest creatinga new catalog (by subclassing or adapting an existing one)
- queues updates
- registers a before-commit callback with the TM on the first update
in a transaction
- processes the queue in the callback
I did this recently for with Zope 3's catalog and it worked very well.
(I happend to use subclassing and would use adaptation if I were to
do it again.)
Jim Fulton mailto:[EMAIL PROTECTED] Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
For more information about ZODB, see the ZODB Wiki:
ZODB-Dev mailing list - ZODB-Dev@zope.org