[Zope-dev] Re: circular referenced persistent objects

zope at netchan.cotse.net zope at netchan.cotse.net
Mon Apr 12 11:57:43 EDT 2004


Casey,

Thanks for the clarification.

> >  - Is there an equivalent of sys.getrefcount for ZODB persistent
> > objects?

This is still a question. Is there any way, to determine how many times
a zodb persistent object is referenced? sys.getrefcount seems to tell me
only those references which are currently loaded in the memory.
Also another very interesting question is that who referring to a
specific object.

> > For this I got the oid of the object,
> > deleted it and than tried to get it back via the oid. The trick is,
> > that you'll only get a POSKeyError if you pack the database 
> and flush
> > the cache. This latter one was not obvious for me.
> 
> Such tricks are not necessary and cause your app to rely too 
> much on the
> curent implementation of ZODB. Just let the database take care of this
> for you.

I used this trick only for exploring ZODB behavior. The application
doesn't do any nasty tricks.

Regards,
Sandor




More information about the Zope-Dev mailing list