[ZODB-Dev] Getting refcount of object in ZODB

Greg Ward gward@mems-exchange.org
Thu, 28 Jun 2001 14:23:09 -0400


On 28 June 2001, Barry A. Warsaw said:
> There's no advertised storage API way of getting this information
> AFAIK.  Different storages will maintain that information in different
> ways (e.g. in Berkeley Full, it's maintained in a separate table --
> well, two tables really, one for objects and the other for pickles ;).

So is GC entirely the storage's responsibility, then?  I.e., should I be
poking about in FileStorage.py looking for rude back-door ways of
getting the refcount?

Or should I just say: Jim, given DB/Connection/FileStorage objects and
either an OID or database object, how do I get the refcount for the
object?  And is that info available for ClientStorage as well?  Or will
I have to shutdown my ZEO server and access the database as a
FileStorage to find this out?

No, I do *not* intend to use this in an application, it's mainly
curiosity.  I want to make sure that an object I think is about to drop
to zero refs really does drop to zero refs.

        Greg