[ZODB-Dev] List of modified objects

Kapil Thangavelu hazmat at objectrealms.net
Sat Dec 4 14:30:03 EST 2004


fwiw,

i put together a transaction observer api for zodb < 3.3

viewcvs

http://svn.objectrealms.net/view/public/transactionobserver/trunk/

checkout

svn co https://svn.objectrealms.net/svn/public/transactionobserver/trunk

for zodb3.3, it would be nice if an optional observable or
introspectable interface could be on connections, for this sort of
functionality to be duplicated.

cheers,

-kapil

On Thu, 2004-12-02 at 09:59 -0500, Tim Peters wrote:
> [Thomas Guettler]
> >>> 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.
> 
> [Christian Robottom Reis]
> >> If you don't use subtransactions, it's an easy answer:
> >>
> >>     connection.getTransaction()._objects
> >>
> >> If you do, I can't say I know.
> 
> Me neither.
> 
> [Jim Fulton]
> > Of course, because this relies on changable implementation details, it's
> > very brittle. For example, this won't work reliably in ZODB 3.3.
> 
> In 3.3 it will blow up with AttributeError every time, so it's reliable, it
> just doesn't work at all <wink>.
> 
> Gloss:  prior to 3.3, transactions keep track of modified objects, with the
> oft-noted consequence that a transaction never learns about a connection
> that hasn't modified an object.  In 3.3, connections keep track of their own
> modified objects, and the connections (not the objects) register with the
> transaction.  That's why there's no way to cheat (using private attributes,
> neither anything else) that can work across both.
> 
> > There isn't a public API for this. I think that there should be.
> 
> I'll add it to the ZODB 3.4 wish list.
> 
> _______________________________________________
> For more information about ZODB, see the ZODB Wiki:
> http://www.zope.org/Wikis/ZODB/
> 
> ZODB-Dev mailing list  -  ZODB-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zodb-dev
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/zodb-dev/attachments/20041204/89527bf8/attachment.bin


More information about the ZODB-Dev mailing list