[ZODB-Dev] resolve oid to object?

Jeremy Hylton jeremy at zope.com
Tue Jan 6 22:11:23 EST 2004


On Tue, 2004-01-06 at 21:18, Paul Winkler wrote:
> In a zope debugging session using ZEO, is there a way to 
> load a persistent object if I know its zodb OID?
> 
> I did some googling and found an old message to this list
> from Toby Dickenson, suggesting to use storage.load(oid).
> But as documented, ClientStorage.load(oid, version)
> gives back a pickle. Example:
> 
> >>> oid = app._p_oid
> >>> obj = app._p_jar._storage.load(oid)
> 
> In this example, obj is some raw pickle data.
> I was hoping for the result to be that obj is app.

Strangely enough, app._p_jar[oid] will do what you want.  I say
strangely, because the Connection doesn't seem at all like a sequence or
mapping to me :-).

Jeremy





More information about the ZODB-Dev mailing list