[ZODB-Dev] InvalidObjectReference and mount

Shane Hathaway shane@zope.com
Fri, 03 Jan 2003 11:52:12 -0500


Jeremy Hylton wrote:
> If so, what does mounting actually do?  I'm imagining that a mount
> point is a special object that allows traversal from one database to
> another, but doesn't actually allow an object in the database
> containing the mount to have a direct reference to objects in the
> mounted database.

Mounting uses the __of__ feature of ExtensionClass, which Zope uses but 
ZODB does not.  __of__() lets an object mask itself as a different 
object when it is retrieved as an attribute of a parent object.  It's 
similar to descriptors.

So a mounted object is only mounted in the sense that when Zope 
traverses to a special "MountPoint" object, it actually finds a 
different object from a different database.  ZODB is totally unaware.

Shane