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

Marius Gedminas mgedmin at b4net.lt
Wed Feb 14 15:57:27 EST 2007


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.

Marius Gedminas
-- 
Power corrupts, but we need electricity.
-------------- 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/20070214/9cba28aa/attachment.bin


More information about the ZODB-Dev mailing list