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

chaouche yacine yacinechaouche at yahoo.com
Wed Aug 20 08:21:39 EDT 2008


--- On Wed, 8/20/08, chaouche yacine <yacinechaouche at yahoo.com> wrote:

> From: chaouche yacine <yacinechaouche at yahoo.com>
> Subject: Re: [Zope] Need some help to get rid of an InvalidObjectReference exception
> To: "Dieter Maurer" <dieter at handshake.de>
> Cc: zope at zope.org
> Date: Wednesday, August 20, 2008, 5:12 AM
> --- On Wed, 8/20/08, chaouche yacine
> <yacinechaouche at yahoo.com> wrote:
> > So the question is now : is there another way to put
> some
> > ZODB objects in the session for future use ? because
> there
> > is no reason to create the same object twice or thrice
> in my
> > product so I want it to stay in the session.
> > 
> > Thanks.
> 
> Maybe I should try this :
> http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/Sessions.stx#3-126
> 
> 
>       
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )


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.











      


More information about the Zope mailing list