Ok, I understand in theory what the problem is, I'm just not clear where in code this could be happening.  I'm not consciously manipulating connections and I guess Zope is taking care of those low-level connection details with the ZODB for me.

Can I programmatically determine whether an object is already loaded/cached by a different connection?
Would it help to try isolate this routine to a single connection?
*Can* I isolate this routine to a single connection?

You know, I'm starting to think that my fancy little recursion between objects is what's royally screwing things up.  A lot of loading of objects occurs here, possibly touching on the same objects between calls...

Any other pointers/hints are welcome!

Thank you Dieter and anyone else who can help out!


On 11/9/06, Dieter Maurer < [EMAIL PROTECTED]> wrote:
Garth B. wrote at 2006-11-9 11:21 -0500:
>I'm sporadically getting the following error thrown as a result of a routine
>I've written.
>InvalidObjectReference: Attempt to store a reference to an object from a
>separate connection to the same database or multidatabase.

This is in indication that you have introduced a persistency bug:

  It is very essential that you use a persistent object only
  in the context of the ZODB connection that loaded this object.

  Failing to fulfill this requirement can lead to several kinds
  of difficult to understand errors. The one, you see above
  is one such kind.

  Apparently, you try to store a persistent object from a connection "C1"
  as attribute of a persistent object from a different connection "C2".

The bug is usually introduced by storing persistent objects outside
of their connection cache -- e.g. on class level or in a module level


Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to