the referenced code, was moving an object from a session (ram zodb ) to a persistent zodb, and making it explicitly not a cross database reference via pickling. shouldn&#39;t pickling the object remove any database reference, all the _p_ variables should be gone, and thus the pickle laundered object is unattached to a db. ie.<br>
<br>&gt;&gt;&gt; import transaction<br>&gt;&gt;&gt; from ZODB.FileStorage import FileStorage<br>&gt;&gt;&gt; from ZODB.DB import DB<br>&gt;&gt;&gt; from persistent import Persistent<br>&gt;&gt;&gt; class bar( Persistent ): pass<br>
... <br>&gt;&gt;&gt; a = bar()<br>&gt;&gt;&gt; db = DB(FileStorage(&#39;tmp&#39;))<br>&gt;&gt;&gt; root = db.open().root()<br>&gt;&gt;&gt; root[&#39;foo&#39;] = a<br>&gt;&gt;&gt; transaction.commit()<br>&gt;&gt;&gt; root[&#39;foo&#39;]<br>
&lt;__main__.bar object at 0x8a530&gt;<br>&gt;&gt;&gt; root[&#39;foo&#39;]._p_jar<br>&lt;Connection at 0062d090&gt;<br>&gt;&gt;&gt; root[&#39;foo&#39;]._p_oid<br>&#39;\x00\x00\x00\x00\x00\x00\x00\x01&#39;<br>&gt;&gt;&gt; from cPickle import dumps<br>
&gt;&gt;&gt; from cPickle import loads<br>&gt;&gt;&gt; x = loads(dumps(root[&#39;foo&#39;]))<br>&gt;&gt;&gt; x<br>&lt;__main__.bar object at 0x7352b0&gt;<br>&gt;&gt;&gt; x._p_jar<br>&gt;&gt;&gt; x._p_oid<br>&gt;&gt;&gt; <br>
<br>although the error message is clear. its not clear if the referenced code section is responsible.<br><br>-kapil<br><br><div class="gmail_quote">On Mon, Jun 29, 2009 at 11:57 AM, Jim Fulton <span dir="ltr">&lt;<a href="mailto:jim@zope.com">jim@zope.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Your application is creating cross-database references. The version of<br>
ZODB you&#39;re using on the ZEO server doesn&#39;t support packing databases<br>
with cross References. Upgrade your ZEO server to ZODB 3.8.1 or ZODB<br>
3.9.<br>
<br>
Jim<br>
<div><div></div><div class="h5"><br>
<br>
On Jun 29, 2009, at 11:54 AM, rafael wrote:<br>
<br>
&gt; Hi,<br>
&gt;<br>
&gt; I don&#39;t know if you are aware of Plone Getpaid issue 209<br>
&gt;<br>
&gt; <a href="http://code.google.com/p/getpaid/issues/detail?id=209" target="_blank">http://code.google.com/p/getpaid/issues/detail?id=209</a><br>
&gt;<br>
&gt; The title of this issue is not 100% correct. As I get this<br>
&gt; corruption without restarting the server.  There are some tracebacks<br>
&gt; over there.<br>
&gt;<br>
&gt; I think the following lines of the payment processor might have to<br>
&gt; do with it<br>
&gt;<br>
&gt;  # make cart safe for persistence by using pickling<br>
&gt;         order.shopping_cart = loads(dumps(cart))<br>
&gt;         order.user_id = getSecurityManager().getUser().getId()<br>
&gt;         order_manager.store(order)<br>
&gt;<br>
&gt;         # have to wait for the order to be created and the cart<br>
&gt; added for this to work<br>
&gt;         order.finance_workflow.fireTransition(&#39;authorize&#39;)<br>
&gt;<br>
&gt;         # save html for button - we&#39;ll destroy the cart later on<br>
&gt;         html = button.cart_post_button(order)<br>
&gt;<br>
&gt;         # and destroy the cart<br>
&gt;         cart_util.destroy(self.context)<br>
&gt;<br>
&gt;         return html<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Recently, I tried moving from zeo to filestorage to see if this was<br>
&gt; related. I get the same error, but now instead of breaking my site<br>
&gt; (givving errors for different actions), it seems it is just<br>
&gt; preventing me from packing... The tracebak I get when packing is:<br>
&gt;<br>
&gt; Traceback (innermost last):<br>
&gt;<br>
&gt;       • Module ZPublisher.Publish, line 119, in publish<br>
&gt;       • Module ZPublisher.mapply, line 88, in mapply<br>
&gt;       • Module ZPublisher.Publish, line 42, in call_object<br>
&gt;       • Module &lt;string&gt;, line 3, in _facade<br>
&gt;       • Module AccessControl.requestmethod, line 64, in _curried<br>
&gt;       • Module App.ApplicationManager, line 431, in manage_pack<br>
&gt;       • Module ZODB.DB, line 624, in pack<br>
&gt;       • Module ZODB.FileStorage.FileStorage, line 1352, in pack<br>
&gt;       • Module ZODB.FileStorage.fspack, line 482, in pack<br>
&gt;       • Module ZODB.FileStorage.fspack, line 228, in findReachable<br>
&gt;       • Module ZODB.FileStorage.fspack, line 304, in<br>
&gt; findReachableAtPacktime<br>
&gt;       • Module ZODB.FileStorage.fspack, line 377, in findrefs<br>
&gt;       • Module ZODB.serialize, line 645, in referencesf<br>
&gt; KeyError: &#39;n&#39;<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Rafael<br>
</div></div>&gt; _______________________________________________<br>
&gt; For more information about ZODB, see the ZODB Wiki:<br>
&gt; <a href="http://www.zope.org/Wikis/ZODB/" target="_blank">http://www.zope.org/Wikis/ZODB/</a><br>
&gt;<br>
&gt; ZODB-Dev mailing list  -  <a href="mailto:ZODB-Dev@zope.org">ZODB-Dev@zope.org</a><br>
&gt; <a href="http://mail.zope.org/mailman/listinfo/zodb-dev" target="_blank">http://mail.zope.org/mailman/listinfo/zodb-dev</a><br>
<br>
--<br>
Jim Fulton<br>
Zope Corporation<br>
<br>
<br>
_______________________________________________<br>
For more information about ZODB, see the ZODB Wiki:<br>
<a href="http://www.zope.org/Wikis/ZODB/" target="_blank">http://www.zope.org/Wikis/ZODB/</a><br>
<br>
ZODB-Dev mailing list  -  <a href="mailto:ZODB-Dev@zope.org">ZODB-Dev@zope.org</a><br>
<a href="http://mail.zope.org/mailman/listinfo/zodb-dev" target="_blank">http://mail.zope.org/mailman/listinfo/zodb-dev</a><br>
</blockquote></div><br>