[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do you handle a schema update?
Hi,
> how do you handle a schema update in ozone? If I modify the classes
> of persistent objects, I get a serialization exception. This is, what I have
> done:
>
> 1. I implemented some database classes.
> 2. I set up the database and filled it with some objects.
> 3. I modified the database classes (added a new instance variable
> and get/set-methods).
> 4. I tried to read an object stored in the database, but failed due to
> the serialization exception.
>
> It looks like this cannot work. My question is, how can I "upgrade" the
> persistent objects to the new classes (having null values for the new
> instance variable, for example) ?
Since the ozone storage is based on the Java serialization mechanism you have
to use the 'serialVersionUID' to get backwards compatiblity of you database
classes. Please, read the regarding section in the Java documentation and look
a the ozone examples.
Best Regards,
Gerd
--
________________________________________________________________
Gerd Mueller gerd@smb-tec.com
SMB GmbH http://www.smb-tec.com