[ZODB-Dev] List of modified objects

Christian Robottom Reis kiko at async.com.br
Thu Dec 2 12:19:22 EST 2004


On Thu, Dec 02, 2004 at 08:43:59AM -0500, Jim Fulton wrote:
> Christian Robottom Reis wrote:
> >On Thu, Dec 02, 2004 at 09:48:04AM +0100, Thomas Guettler wrote:
> >
> >>How can you get the list of all objects which where
> >>modified in a transaction?
> >>
> >>I want to be sure that a read only access does not change
> >>anything. The transaction gets finished with abort(). Before
> >>the abort I like to check if the list of modified objects is empty.
> >
> >
> >If you don't use subtransactions, it's an easy answer:
> >
> >    connection.getTransaction()._objects
> >
> >If you do, I can't say I know.
> 
> Of course, because this relies on changable implementation
> details, it's very brittle. For example, this won't
> work reliably in ZODB 3.3.

Indeed, but since I know Thomas is one of us 3.2 hold-outs, I knew he
could benefit from the experience <wink>. I should point out that this
little list, _objects, empties out at subtransaction boundaries, so
beware trusting it for anything that needs to work reliably if you do
use them.

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331


More information about the ZODB-Dev mailing list