[ZODB-Dev] problem with broken

Christian Theune ct at gocept.com
Thu Nov 6 04:52:47 EST 2008


On Thu, 2008-11-06 at 11:20 +0200, Marius Gedminas wrote:
> On Wed, Nov 05, 2008 at 03:59:07PM +0100, Christian Theune wrote:
> > On Wed, 2008-11-05 at 16:00 +0200, Marius Gedminas wrote:
> > > On Wed, Nov 05, 2008 at 11:48:35AM +0100, Christian Theune wrote:
> > > > On Wed, 2008-11-05 at 11:31 +0100, Laurence Rowe wrote:
> > > > > Broken objects occur when the class for a pickled object cannot be 
> > > > > imported. To change the location of a class, you need to provide an 
> > > > > alias at the old location so that the object can be unpickled, i.e. 
> > > > > MyOldClassName = MyNewClassName. You can only remove MyOldClassName 
> > > > > after you have updated all of the pickles (with your code below).
> > > > 
> > > > Note: We made a relatively good experience by removing those symbols
> > > > from their original modules and provide a generation which first sets up
> > > > dummies, then runs migration code to remove/rebase those objects and
> > > > then remove the dummies again.
> > > 
> > > How do you do that?  Monkey-patching?
> > 
> > Yes. Monkey-patching *and* monkey-unpatching.
> 
> Thought so.
> 
> By the way, this has a potential failure mode when you need to evolve
> more than one generation, and a previous generation script needs to
> access those objects in the old location before your new generation
> script sets up the dummies.

Yes. Our deployments are under relatively tight control and we check
that generations work on a copy of a database before doing the actual
roll-out. In this case we currently estimate that we'll need to change
that earlier generation.

Generations assume that the code looks like what it did when the
generation was written -- which certainly doesn't hold.

Christian

-- 
Christian Theune · ct at gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1
Zope and Plone consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/zodb-dev/attachments/20081106/cabe45d1/attachment.bin 


More information about the ZODB-Dev mailing list