Home Help Center

ICE Serialization - Pass-By-Value versioning Question

lavpatellavpatel Member Lav PatelOrganization: CitigroupProject: MOAccounting
I tried searching on this but couldn't locate any post that is quite related.
Please point me to it if you know/find a match. Otherwise I have a question about ICE serialization as below.

One option to introduce newer fields to an existing object being sent as pass-by-value is to extend it into newer class/struct and place them in it, thereupon if server is latest and client isn't, client will receive sliced object (only of base type) and can still function with original set. Assuming server is always latest, it will always write/read all the information into/from the stream and latest clients will benefit fully from this (no slicing).

I have a requirement to support Pass-By-Value versioning in ICE without extending the existing class/structure. Meaning, I am expecting to introduce new fields into the same existing class. If server is updated with newer class, it will write these new fields into stream and try to read from stream as well. if client isn't yet redeployed with these newly added fields in original class, it shall only read original set from stream ignoring the rest. likewise if client is new, it shall write values for these new fields which older server would ignore.

Is this possible?

we are using ICE 3.2.1, with both C# and Java as client and server.

Happy New Year!


  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff

    Welcome to the forum.

    I'm afraid what you've described is not possible. If you modify the definition of a class or structure to add or remove a data member, or change the type of an existing member, you are almost certainly going to cause the receiver to fail with a marshaling exception.

    We've had requests to add support for a feature like that, but it's not currently a priority. Please contact [email protected] if you'd like to sponsor such a feature.

    Note also that we only provide free support here on the forum for the most recent version of Ice.

    Best regards,
  • lavpatellavpatel Member Lav PatelOrganization: CitigroupProject: MOAccounting
    Thanks for prompt reply.

    checking with [email protected] to see if sponsorship is feasible.
  • mathglmathgl Member gelin yanOrganization: RoundTech Research CentreProject: large scale vehicle tracing system
    another option is to use google proto buffer with ICE but it requires 3.4.1 or above.
Sign In or Register to comment.