[Zope] Session & InvalidObjectReference
Chris McDonough
chrism@zope.com
18 May 2002 11:15:40 -0400
Hi,
Please refer to
http://lists.zope.org/pipermail/zope-coders/2002-February/000804.html
for an explanation.
A solution is to store the path to the query (e.g. '/DB/SQL/anSQLQuery'
rather than the query object itself), then use "restrictedTraverse" to
look it back up again when you need to.
On Sat, 2002-05-18 at 10:08, p.t. wrote:
> I'm trying to remember what was the last SQL query called registering to a
> session the "pointer" to a SQL instance, something like:
>
> anSQLquery = container.DB.SQL.anSQLqury
>
> Howevere, I get this error:
>
> Error Type: InvalidObjectReference
> Error Value: Attempt to store an object from a foreign database connection
>
> just when attempting to write to a session the variable anSQLquery.
>
> The traceback diagnostic is not very helping to me; it says:
>
> (Info: (('Products.Transience.TransientObject', 'TransientObject')
>
> referring to:
>
> Connection.py, line 345, in commit
>
> I did examine the code, but unfortunately my limited knowledge of such a
> sophisticated Python code gives me no possibility to uderstand what's wrong.
>
> Any suggestion on how to avoid this error message?
> TIA,
> p.t.
>
>
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )