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'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>>>> import transaction<br>>>> from ZODB.FileStorage import FileStorage<br>>>> from ZODB.DB import DB<br>>>> from persistent import Persistent<br>>>> class bar( Persistent ): pass<br>
... <br>>>> a = bar()<br>>>> db = DB(FileStorage('tmp'))<br>>>> root = db.open().root()<br>>>> root['foo'] = a<br>>>> transaction.commit()<br>>>> root['foo']<br>
<__main__.bar object at 0x8a530><br>>>> root['foo']._p_jar<br><Connection at 0062d090><br>>>> root['foo']._p_oid<br>'\x00\x00\x00\x00\x00\x00\x00\x01'<br>>>> from cPickle import dumps<br>
>>> from cPickle import loads<br>>>> x = loads(dumps(root['foo']))<br>>>> x<br><__main__.bar object at 0x7352b0><br>>>> x._p_jar<br>>>> x._p_oid<br>>>> <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"><<a href="mailto:jim@zope.com">jim@zope.com</a>></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're using on the ZEO server doesn'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>
> Hi,<br>
><br>
> I don't know if you are aware of Plone Getpaid issue 209<br>
><br>
> <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>
><br>
> The title of this issue is not 100% correct. As I get this<br>
> corruption without restarting the server. There are some tracebacks<br>
> over there.<br>
><br>
> I think the following lines of the payment processor might have to<br>
> do with it<br>
><br>
> # make cart safe for persistence by using pickling<br>
> order.shopping_cart = loads(dumps(cart))<br>
> order.user_id = getSecurityManager().getUser().getId()<br>
> order_manager.store(order)<br>
><br>
> # have to wait for the order to be created and the cart<br>
> added for this to work<br>
> order.finance_workflow.fireTransition('authorize')<br>
><br>
> # save html for button - we'll destroy the cart later on<br>
> html = button.cart_post_button(order)<br>
><br>
> # and destroy the cart<br>
> cart_util.destroy(self.context)<br>
><br>
> return html<br>
><br>
><br>
><br>
> Recently, I tried moving from zeo to filestorage to see if this was<br>
> related. I get the same error, but now instead of breaking my site<br>
> (givving errors for different actions), it seems it is just<br>
> preventing me from packing... The tracebak I get when packing is:<br>
><br>
> Traceback (innermost last):<br>
><br>
> Module ZPublisher.Publish, line 119, in publish<br>
> Module ZPublisher.mapply, line 88, in mapply<br>
> Module ZPublisher.Publish, line 42, in call_object<br>
> Module <string>, line 3, in _facade<br>
> Module AccessControl.requestmethod, line 64, in _curried<br>
> Module App.ApplicationManager, line 431, in manage_pack<br>
> Module ZODB.DB, line 624, in pack<br>
> Module ZODB.FileStorage.FileStorage, line 1352, in pack<br>
> Module ZODB.FileStorage.fspack, line 482, in pack<br>
> Module ZODB.FileStorage.fspack, line 228, in findReachable<br>
> Module ZODB.FileStorage.fspack, line 304, in<br>
> findReachableAtPacktime<br>
> Module ZODB.FileStorage.fspack, line 377, in findrefs<br>
> Module ZODB.serialize, line 645, in referencesf<br>
> KeyError: 'n'<br>
><br>
> Thanks,<br>
><br>
> Rafael<br>
</div></div>> _______________________________________________<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>
<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>