On Thu, Dec 17, 2009 at 4:06 PM, Marius Gedminas <mar...@gedmin.as> wrote:
> I'd like to implement the following feature for zodbbrowser: given a
> persistent object X, find all other persistent objects that have
> references to it.
>
> My use case for this is debugging: e.g. given a log entry that mentions
> a conflict error about an OOBTreeBucket, I'd like to know which OOBTree
> object contains it, and what object wraps the OOBTree, and at that point
> I usually see a container with a __name__ and __parent__ and can figure
> out what's going on.
>
> I realize that ZODB doesn't keep track of backreferences, so the only
> way to get that is to do a full object traversal, which is expensive in
> both CPU and memory.

...

> ?  Is there existing code I could use for inspiration?  zodbex?  zc.zodbgc?
> Bits and pieces of ZODB itself?

zc.zodbdgc's multi-zodb-check-refs script will optionally produce a database
of reverse references that your browser could use.

Note that building this database can take a very long time.

Jim

-- 
Jim Fulton
_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to