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

Petra Chong Petra.Chong at pelotonpartners.com
Thu Feb 15 03:24:13 EST 2007


Many thanks to all for their replies.

Before I start reading source I tend to prefer to ask if anyone knows
directly- if no-one does, then source it is. 

Regards,

PC 

-----Original Message-----
From: zodb-dev-bounces+petra.chong=pelotonpartners.com at zope.org
[mailto:zodb-dev-bounces+petra.chong=pelotonpartners.com at zope.org] On
Behalf Of Marius Gedminas
Sent: 14 February 2007 20:57
To: zodb-dev at zope.org
Subject: Re: [ZODB-Dev] Making use of the zodb transaction framework
outsideof zodb?

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.

Peloton Partners LLP is registered in England (registration number OC307362) with its registered office address at 17 Broadwick Street, London W1F 0DJ. This message may contain confidential and/or privileged material. It is intended only for use by the named recipient(s). This message is for informational purposes only and must not be construed as an offer or solicitation to buy or sell any security. Peloton Partners LLP does not represent that it is accurate, complete and/or up-to date and accepts no liability if it is not. All opinions expressed do not necessarily reflect those of Peloton Partners LLP or its affiliates. Peloton Partners LLP is authorised and regulated by the Financial Services Authority.



More information about the ZODB-Dev mailing list