[ZODB-Dev] Loading objects directly by OID

Barry A. Warsaw barry@zope.com
Mon, 5 Nov 2001 16:59:46 -0500


>>>>> "GW" == Greg Ward <gward@mems-exchange.org> writes:

    GW> I don't think that's *exactly* the situation I'm encountering,
    GW> though.  Note that I worded my question quite carefully:

    |   ... but for B to not be loadable via the storage's load()
    |   method?

    GW> B (the object referenced by object A), certainly appears to be
    GW> in the database.  It gets loaded if I follow object references
    GW> to get to it, eg. if I do dir(A).  But I can't load it by
    GW> passing its OID to the storage's load() method.

Could it be a version thing?  I.e. is the object living in a version
other than the one you pass in to the load() method?  OTOH, it doesn't
make sense that you wouldn't have a non-version revision of the object
(which will always get returned if load(..., version='') is used or if
the supplied version isn't the one the object is stored in).

IOW, AFAIK, there's no other way for ZODB to load an object's pickle
from a storage except through load() and loadSerial(), so if you can't
load it directly from the storage that way, Something Else must be
going on.

-Barry