[ZODB-Dev] zodb wants to import my module?

Chris Bainbridge chris.bainbridge at gmail.com
Thu Nov 11 05:17:32 EST 2004


Adding my code to the zeo servers PYTHONPATH did indeed stop the
problem. I'd already thought to do that but thought it might be wrong
since it's not mentioned anywhere in the documentation. Thanks for
your help.


On Wed, 10 Nov 2004 19:45:35 -0500, Tim Peters <tim at zope.com> wrote:
> [Tim Peters]
> > ...
> > I don't have a deep understanding of this part of the code (it's
> > complicated and obscure), and it's possible there's a bug.  But, offhand,
> > it looks to me like it would work fine if the ZEO server (as well as the
> > ZEO client) had your persistent class implementation code.
> >
> > If it did, the transaction in question still would have failed, but by
> > raising ConflictError instead.
> 
> Looking some more, that still all appears to be the case, plus some:
> 
> ZODB before 3.3 didn't name the class of the object involved in a
> ConflictError, and getting it to do so was a semi-popular request.  So the
> code that's *trying* to insert the class name is new in 3.3.  It does so by
> actually loading "the first part" of the ZODB object pickle, which requires
> that the object's class's implementation code exist on the ZEO server.  I
> think that's a poor idea, for the reason you discovered.  There's another
> way to do it, which doesn't require using pickle.load(), or importing any
> application module or class objects.
> 
> I expect it wasn't done that way to begin with because no utility function
> for doing so exists, but reusable code for getting the class name via
> loading a pickle did (or, in 3.3, does) exist.  I'll try to change that.
> 
>


More information about the ZODB-Dev mailing list