[ZODB-Dev] checking what refers to an object in zodb

Dieter Maurer dieter at handshake.de
Fri May 4 15:27:54 EDT 2007


Chris Withers wrote at 2007-5-4 18:53 +0100:
>To try and find out which objects were referencing all these workflow 
>histories, we tried the following starting with one of the oid of these 
>histories:
>
>from ZODB.FileStorage import FileStorage
>from ZODB.serialize import referencesf
>
>fs = FileStorage(path, read_only=1)
>data, serialno = fs.load(oid, '')
>refs = referencesf(data)
>
>To our surprise, all of the workflow histories returned an empty list 
>for refs.

Isn't that very natural?

"referencesf(data)" determines which objects are referenced by
"data" and not which objects do reference the object the state of
which is given by "data".

Usually, the workflow history does not reference persistent objects.



-- 
Dieter


More information about the ZODB-Dev mailing list