Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7858959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:42:02+00:00 2026-06-02T21:42:02+00:00

I have got a problem with Java serialization. Suppose I had one Object persisted

  • 0

I have got a problem with Java serialization. Suppose I had one Object persisted to file system. How can we update the structure of the files according to object structure modification in latter version?

For example if I saved Object

A{int a; String b} to file

And I changed a structure to A{int a; String b, char c} is there any way I can change previous saved files according to latter version of A?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T21:42:03+00:00Added an answer on June 2, 2026 at 9:42 pm

    It’s possible. You’ll need to make the next version backward-compatible with the previous version. The ways to do that are explained in the Java serialization specification: http://docs.oracle.com/javase/1.3/docs/guide/serialization/spec/version.doc.html.

    This problem, however, is a good example of why using the native Java serialization to persist objects for a long time is usually a bad idea. If you had used a specific format (XML, JSON or whatever), you could easily read and transform the files themselves, or be able to read any version of the file with different implementation of the serializer, and thus migrate more easily from one version to another.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can't understand what is a problem here: I have got main.cpp file where I
ok i got this problem. i have this routes: (code bit change) File:/home/dotcloud/current/config/routes.js exports.routes
I have got problem with sending int from Java Client to C++ server. I
I'm programming both in JAVA and PHP. I got one problem with string comparison.
Guys, I have got a slightly different problem with Java Dynamic class loading. I
I'm a beginner in Java and I have got some problems with the static
I have got a problem with calling a global function, which takes a pointer
I have got the following problem since the server has safe mode turned on,
I have got a strange problem about in_array recently which I cannot understand. e.g.
I have got a performance problem about TextField.htmlText +=msg .And I know that TextField.appendText(msg)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.