[Zope-Coders] ZODB question
Chris McDonough
chrism@zope.com
Sun, 17 Feb 2002 10:45:30 -0500
Here's something from the CST docs that tries to explain it:
Persistent objects which have references to other persistent
objects in the same database cannot be committed into a mounted
database because the ZODB does not currently handle
cross-database references.
"Internal" (RAM-based) session data containers are currently
implemented as objects within (automatically) mounted ZODB
databases. For this reason, they are equivalent in operation to
external session data containers which are placed in a manually
mounted database.
If you use an internal session data container or an external
session data container that is accessed via a "mounted"
database, you cannot store persistent object instances which
have already been stored in the "main" database as keys or
values in a session data object. If you try to do so, it is
likely that an 'InvalidObjectReference' exception will be raised
by the ZODB when the transaction involving the object attempts
to commit. As a result, the transaction will fail and the
session data object (and other objects touched in the same
transaction) will fail to be committed to storage.
If your "main" ZODB database is backed by a nonundoing storage,
you can avoid this condition by storing session data objects in
an external data container instantiated within the "main" ZODB
database. If this is not an option, you should ensure that
objects you store as values or keys in a session data object
held in a mounted session data container are instantiated "from
scratch" (via their constructors), as opposed to being "pulled
out" of the main ZODB.
----- Original Message -----
From: "Andreas Jung" <andreas@andreas-jung.com>
To: <zope-coders@zope.org>
Sent: Sunday, February 17, 2002 8:27 AM
Subject: [Zope-Coders] ZODB question
> What's the meaning of the following error message ?
>
> Error Type: InvalidObjectReference
> Error Value: Attempt to store an object from a foreign database connection
>
> Andreas
>
>
>
>
>
> _______________________________________________
> Zope-Coders mailing list
> Zope-Coders@zope.org
> http://lists.zope.org/mailman/listinfo/zope-coders
>