[Zope] Question regarding InvalidObjectReference and the storing of objects in the session

Chris Withers chrisw@nipltd.com
Thu, 17 Jul 2003 13:21:30 +0100


Alec Munro wrote:
> 
> I've had a system where I was storing object URLs in the session, and 
> using restrictedTraverse to access the objects. I got it in my mind 
> today that perhaps my knowledge of zope had expanded to the degree that 
> I could figure out how to bypass this step and simply store the objects 
> themselves in the session.

You can't really do that. The session is in one ZODB (TemporaryStorage), while 
the rest of your data is in another (most likely FileStorage).
ZODB won't let you store an object from one storage in another storage...

So, you'll have to stick to storing paths to objects...

cheers,

Chris