[ZODB-Dev] Making use of the zodb transaction framework outside of zodb?

Marius Gedminas mgedmin at b4net.lt
Wed Feb 14 17:36:10 EST 2007


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zodb-dev/attachments/20070215/5acc7ea8/attachment.bin


More information about the ZODB-Dev mailing list