[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help



On Fri, 28 Apr 2000, you wrote:
> Hello,
> 
> I am using ozone for saving my java object.
> I would like to clarify few of my doubts.
> 
> I am saving java object in to a ozone, suppose
> 
>     1. If I just recompile the entire package
>         including the stored object without any
>         modification, Is it possible to read the
>         old objects stored before recompiling.
Yes, if there are serialVersionUIDs defined in the code of the database classes.

> 
>     2.  If I add new methods only in the object
>         to be stored, and compile it, then
>         in this case is it possible to load
>         the old objects ?
Yes, if...

> 
>     3. If I add a new member veriable to
>         the object to be stored and compile
>         it, then  in this case is it possible to
>         load  the old objects ?
Yes, if...

> 
>       Overall My question is when it is not
>         possible to load the old objects from
>         ozone ? if so are there any ways
>         to restore the old objects ?
This depends on the serialization mechanism that you use. If you are just using
Serializable then it's not possible to change the type of a meber or remove it
and then loading old data with new classes. 
If you are using Externalizable to to serialize your objects than its
completely up to you to define the stream format. So you can always add code
that deal with backward compatibility with old object data.


Falko
-- 
______________________________________________________________________
Falko Braeutigam                         mailto:falko@softwarebuero.de
softwarebuero m&b (SMB)                    http://www.softwarebuero.de