My Oracle Support Banner

Coherence:3.7.1.6-How to implement POFSerialiser Using The Evolvable/AbstractEvolvable (Doc ID 1510704.1)

Last updated on NOVEMBER 19, 2019

Applies to:

Oracle Coherence - Version 3.7.1.6 and later
Information in this document applies to any platform.

Goal

Business Requirement scenario as below:

We are writing the POFSerializer classes for all of our Domain objects to make them backward compatible using the Evolvable interface. We have implemented the POFSeriablizable (CarTypeDisplayRankPofSerializer) for the Domain object (CarTypeDisplayRank) With the Serializer. How to implement the Evolvable interface?

Do we need to implement the Evolvable on the Domain object?

We refer below link:

http://coherencedownunder.wordpress.com/2012/08/30/evolving-your-cache-object-online/

The only Question:

If we add a new attribute to the Object(Address) which is part of the Person, How do we need to modify the serialization routine to handle this? As when we do the serialize/deserializer. the whole object structure is in a single stream.

Here is the Person class & Address class in the old


public class Person {
String firstname;
String lastName;
Address address;
String emailAddress;
}

public class Address {
String address1;
String address2;
String cityName,
String stateCode;
String zipCode;
}

Now adding an attribute to the Address class in the new release

public class Address {
String address1;
String address2;
String cityName,
String stateCode;
String zipCode;
String countryCode;
}

How does the Evolvable interface need to be implemented for this as when we do the serialize & deserialize. We do this on Person object which has address. So, If I do the readReminder() on the PofReader then it will read the whole stream in the old version which causes EOFException when I try to read the emailAddress of the Person object as it was after the Address.

Please answer considering the above scenario.

 

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.