[ZODB-Dev] Missing loader for multidatabase refs?

Jim Fulton jim at zope.com
Fri Mar 30 07:21:37 EDT 2007


On Mar 29, 2007, at 7:04 PM, Sidnei da Silva wrote:

> While doing a 'pack' on a Zope instance that is using multiple
> databases, a KeyError 'n' happened. Upon investigation, we found out
> that the 'oid_loaders' dictionary used by 'referencesf' (in
> ZODB.serialize), which is in turn used by pack (presumably to find the
> oids referenced by an object), doesn't have a loader registered for
> 'n'.
>
> A reference_type of 'n' means:
>
>    'n'
>        Multi-database simple object reference.  The arguments consist
>        of a databaase name, and an object id.
>
> The ObjectReader class defined a few lines above 'referencesf' *does*
> know how to load a multi-database simple object reference.
>
> Now my question is, should 'referencesf' load those multi-database
> references, or should they be treated just like the 'weak references',
> by returning None, or should something else happen?

They should be treated as weak references, at least for now.

> Or maybe that
> reference shouldn't be there in the first place?

Where?  There references should certainly be in the data records,  
otherwise, cross-database references wouldn't work at all.

> This problem is preventing us from packing a database. It just falls
> dead with the KeyError 'n' when packing.

What version of ZODB are you using?

Jim

--
Jim Fulton			mailto:jim at zope.com		Python Powered!
CTO 				(540) 361-1714			http://www.python.org
Zope Corporation	http://www.zope.com		http://www.zope.org





More information about the ZODB-Dev mailing list