On Wed, Feb 14, 2007 at 10:57:27PM +0200, Marius Gedminas wrote:
> On Tue, Feb 13, 2007 at 06:27:57PM -0000, Petra Chong wrote:
> > In the docs I have read that it is possible for non-zodb apps to plug
> > into the transaction framework. However, I am unable to find any
> > specifics as to how to do this. 
> 
> Read the Source, Luke.  ;)
> 
> > What I'd like to do is this:
> > 
> > 1. Have my app import transaction
> > 2. When transaction.commit() is called from my app, have other things be
> > notified by that.
> 
> I've done that a couple of times.  What you have to do, is write a data
> manager class and register it with the current transaction (by calling
> transaction.get().join(your_data_manager_instance)).  Then, when
> you get to transaction.commit() or transaction.abort(), your data
> manager will be notified accordingly.
> 
> See transaction.interfaces.IDataManager.

I just remembered where you can find an example: the transactional mail
sender in Zope 3 (zope.sendmail.delivery.MailDataManager).

Marius Gedminas
-- 
Place mark here ->[ ]<- if you want a dirty monitor.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to