[ZODB-Dev] Loading objects directly by OID

Barry A. Warsaw barry@zope.com
Mon, 5 Nov 2001 11:58:37 -0500


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

    >> Is it ever legal/possible for object A's pickle to contain a
    >> reference to OID B, but for B to not be loadable via the storage's
    >> load() method?

I have two ways to answer this: yes, and I don't know. :)

>From a practical standpoint, I think the answer is yes, this is
possible.  I say this because I've seen this happen in my
FS->BDB migration tests.  I take a FS for real live data, use
copyTransactionsFrom() to create a BDB from this, and then do a pack()
on the BDB database.  I've definitely seen pickles containing
references to other objects (oid) that are not in the database.  I
suppose it's possible that either the original FS is inconsistent, or
the migration script could have bolluxed things up, but I suspect
that's just the way things sometimes happen.

As for whether this is an expected behavior of storages, only Jim can
say.  To me, it seems pretty bizarre that this would be possible in a
properly functioning storage.

-Barry