[ZODB-Dev] Changing Baseclass

Thomas Guettler hv at tbz-pariv.de
Fri Nov 28 08:15:32 EST 2003


Am Donnerstag, 27. November 2003 13:34 schrieben Sie:
> Changing the baseclasses of an object and then hoping that the unpickling
> work out-of-the-box
> (in terms of an automatic migration) is a bit a weird idea.

Yes, I know. The first email did not contain some
thoughts I had:

I developed a prototype of an application. There was only
one object which inherited from Persistent. All were pickled
by reachability. AFAIK, this means that the whole database was
written to the filesystem for every http request.

Now I am rewriting the prototype. This time it was no problem, since
I could throw away all old objects. But if the application is in production,
I need to migrate.

How would you migrate existing objects, if you want to change
the baseclass?

I would create objects from the new class, and use old.__getattr__() and
new.__setattr__() for every object of this class.

I hope you now understand what I mean.

 Have a nice weekend,
    Thomas








More information about the ZODB-Dev mailing list