aspose file tools*
The moose likes Java in General and the fly likes Java object persistance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

Java object persistance

Mahesh Bamane
Ranch Hand

Joined: Mar 12, 2008
Posts: 68
In case I persist the object and later on change the defination of the class, how can retrieve the object in this scenario?


There is nothing like trying, either you do it or you don't.
SCJP 1.5
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39828
    
  28
We would need to know more details before we can give a sensible answer. What are you saving? How? Serialisation? Beans and XML file? Databases?
Mahesh Bamane
Ranch Hand

Joined: Mar 12, 2008
Posts: 68
Thanks Ritchie for your reply.

To explain, I've Class Car whose object I persist using java serialization mechanism; later on I go and change the class defination of a Car. Now I want to deserialize the class object. How this scenario should be handled as I've changed the class defination and now want retrive the object but it's stored as per the old class defination.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3611
    
  60

Googling java serialization version control might help.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3611
    
  60

Duplicate of this thread. Locking this one, please continue the discussion on the other thread.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java object persistance