Problem with Cut/Paste across mounted databases

Bug #143248 reported by Brent Hendricks
2
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Medium
Unassigned

Bug Description

I've observed that cut/paste fails across mounted databases when using ZODBMountPoint, raising an

InvalidObjectReference: Attempt to store an object from a foreign database connection

The attached unit test demonstrates this behavior. It tests both cut/paste (which succeeds) and copy/paste (which fails). If you place it in OFS/tests and then run 'test.py -v --dir lib/python/OFS' you should see the InvalidObjectReference error.

I believe the problem is that when pasting the object into a different ZODB, it notices that it has a _p_jar from the other ZODB and complains. My first thought was to just remove _p_jar, but that doesn't seem to be allowed, so I created a new copy of the object. I'll attach my suggested patch. It does allow my testcase to pass and doesn't seem to cause any other tests to fail, but I'm not 100% sure it's the best approach. This problem deals with persistence at a level somewhat beyond me :)

Tags: bugday
Revision history for this message
Brent Hendricks (brentmh-rice) wrote :
Revision history for this message
Brent Hendricks (brentmh-rice) wrote :

Uploaded: CopySupport.patch

Proposed patch

Tres Seaver (tseaver)
Changed in zope2:
status: New → Triaged
tags: added: bugday
removed: bug+solution zope
Revision history for this message
Colin Watson (cjwatson) wrote :

The zope2 project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope2.

Changed in zope2:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.