[ZODB-Dev] List of modified objects
Jeremy Hylton
jhylton at gmail.com
Fri Dec 3 09:16:19 EST 2004
On 03 Dec 2004 10:37:52 +0100, Syver Enstad <syver at inout.no> wrote:
> "Tim Peters" <tim at zope.com> writes:
>
> > > There isn't a public API for this. I think that there should be.
> >
> > I'll add it to the ZODB 3.4 wish list.
>
> Somewhat related would be my wish for a hook called on commit of the
> transaction which would allow objects to register certain information,
> in my case a timestamp for the commit time and the name of the user
> making the change. I use __getstate__ for this today but that seems
> like a hack.
This feature already exists. The transaction manager has a
registrySynch() method, It should be passed a Synchable object, that
is one with method beforeCompletion() and afterCompletion() that each
take a transaction object. beforeCompletion() is called at the
beginning of two-phase commit and afterCompletion() is called at the
end of two-phase commit. The Connection uses a synchronizer to
process invalidations at the end of a transaction.
See the source for details.
Jeremy
More information about the ZODB-Dev
mailing list