[Zope] Need some help to get rid of an InvalidObjectReference exception

Dieter Maurer dieter at handshake.de
Sat Aug 23 06:57:23 EDT 2008


chaouche yacine wrote at 2008-8-20 05:21 -0700:
> ...
>Ok here's how I did to finally fix it :
>
>* create a new Transient Object Container (sessionTOC) at root
>* create a new Session Data Manager (sessionDM), with the following settings :
>** Id : sessionDM
>** Transient Object Container Path : /sessionTOC
>** Place SESSION in REQUEST object as : ZODBSESSION
>
>Now I can put ZODB objects in ZODBSESSION using something like : 
>
>context.REQUEST.ZODBSESSION.set("object",o)
>
>Thanks to all of you for your precious help.

I already know that you have abandoned this approach already (good).

What you did: you have put the sessions into the main ZODB storage.
The ZODB can have the same persistent object at different places
in the persistent graph. *HOWEVER* Zope usually does not like
its (what I call site building) objects to be at different places.

This means, that templates and scripts behave quite differently
(their "container" changes and maybe their "context") dependent
on the location from which they have been fetched.


Do not put templates/scripts at secondary positions in the ZODB
(use just a single primary position). Use instead references (e.g. paths)
to the templates/scripts and resolve the references to the real objects.



-- 
Dieter


More information about the Zope mailing list