On 11/25/15 8:25 AM, Paul Benedict wrote:
Chris, you raise a good question. Example: JPA entities stored in an immutable
list and the list belongs to a stateful EJB that gets passivated or clustered.
Obviously, serialization would be occuring.

On Wed, Nov 25, 2015 at 10:14 AM, Chris Hegarty <chris.hega...@oracle.com
<mailto:chris.hega...@oracle.com>> wrote:

    Is there any impact on the Serializability of these collections, if
    they are “value” based?  I don’t think so, but I’m not sure, since
    their serial form is not documented.  Note to self: should we
    document their serial form?

For JDK 9, the plan is as follows. The current API specification requires the collections be serializable. My plan is for the optimized implementations to use a common serialization proxy class; that class is the only one that will have its serial form documented. This preserves flexibility to change the optimized implementations.

The collections returned by the skeleton implementation are in fact serializable, and this is tested by the regression tests. However, the serialized form is not final. I've asked the JCK team to hold off developing serialization tests until the serial proxy stuff gets in, at which time we can commit to its documented serial form.

I don't know how serialization will work in the hypothetical value-typed future. Using a serial proxy will, I hope, sidestep the issue of how a value type is represented in the serialized object stream. Of course, this assumes that the serialization mechanism, including proxying, continues to work similarly for value types as it does for ordinary objects.

s'marks

Reply via email to