[ZODB-Dev] persisting "immutable" classes

Christian Robottom Reis kiko at async.com.br
Mon Mar 1 16:09:03 EST 2004


On Mon, Mar 01, 2004 at 03:56:10PM -0500, John Belmonte wrote:
> >I think I misunderstood your question.  The conflict resolution code is
> >plain-old Python code.  It can use whatever classes you want to use, but
> >you have to be sure that the code for those classes is available on the
> >server.  It looks like the unpickler is failing the find the JobKey
> >class.  Are you sure that code is available on the server?
> 
> OK, so it's back to that issue-- that seems a bit more reasonable.
> 
> When I change nothing other than making JobKey derive from Persistent, 
> there is no unpickling problem during conflict resolution.  So is 

Because the conflict didn't occur in JobKey's state. JobKey is only
trying to be loaded because it's not a Persistent object and its
container's state conflicted; [as usual] the container's whole state
will try to be loaded, which includes JobKey's state.

> Persistent doing anything fancy to help locate JobKey?  Registering the 
> class somewhere?

AFAIK, the container's pickle state specifies the referred second-class
object's class, so the server knows exactly what it should try to load.
The directory layout specifying the classes should be the same on both
client and server.

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331



More information about the ZODB-Dev mailing list