chaouche yacine wrote at 2008-8-18 09:50 -0700:
>Need some help to get rid of an InvalidObjectReference exception
>In my zope product, when I try to put some specific object in the session, I 
>get this :
>2008-08-18T14:51:02 ERROR(200) SiteError 
>Traceback (most recent call last):
>  File "/opt/Zope-2.7/lib/python/ZPublisher/", line 107, in publish
>    transactions_manager.commit()
>  File "/opt/Zope-2.7/lib/python/Zope/App/", line 222, in commit
>    get_transaction().commit()
>  File "/opt/Zope-2.7/lib/python/ZODB/", line 241, in commit
>    ncommitted += self._commit_objects(objects)
>  File "/opt/Zope-2.7/lib/python/ZODB/", line 356, in 
> _commit_objects
>    jar.commit(o, self)
>  File "/opt/Zope-2.7/lib/python/ZODB/", line 452, in commit
>    dump(state)
>InvalidObjectReference: Attempt to store an object from a foreign database 

A given persistent object can only be in one (ZODB-) database, not in several
databases at the same time.

You must copy the persistent object, when you want it to be stored
(also) in another (ZODB-) database.

You can use the "_getCopy(destination)" method to create such
a copy. "_getCopy" is defined by "OFS.CopySupport.CopySource" inherited
by most Zope objects.

Zope maillist  -
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to