[Zope] Catch Object Changes

Dieter Maurer dieter at handshake.de
Fri Nov 28 16:44:41 EST 2003


Holger Schmidt wrote at 2003-11-28 01:47 +0100:
 > I have a list of objects.
 > The list can contain objects like Folders, PropertyObjects or just every
 > product that you have installed (but has to be accessible via the ZMI).
 > 
 > My problem is that I want to do some XML-RPC to another Zope instance
 > whenever some object of my list has changed (the XML-RPC depends on
 > the object which has changed, that means that I also need to get the
 > (commited?) changed object at this time).
 > 
 > My idea to solve this problem:
 > 1.) get to know when ANY object in Zope is changed
 > 2.) check if this object is in my list
 > 3.) if the list contains the object: start a thread managing the XML-RPC
 > 
 > Problem is step 1 ... how can Zope tell me that ANY object is changed ...?

Looks like you want a specialized transaction or ZODB connection.

  Whenever an object is changed, it registers with the transaction.

  When the transaction is about to commit, it informs
  the object's ZODB connection that the object was modified.

  Zope uses a two level commit protocol, thus one affected
  connection may vote against the commit.

  This means, the hook you are looking for is somewhere in
  transaction or two level commit handling.

-- 
Dieter



More information about the Zope mailing list