开发者

EHCache And Java Serialization Versioning Control

EHCache allows for persistance of the cache, and it requires all objects that are being cached to be Serializable. The objects that are being serialized and written to the Disk are being written with ObjectOutputStream开发者_开发技巧, which is fixed in its required fields and UID. link text

My question is: Is there a way to force the serialization [i.e. overwritting writeObject] to force an non-fixed/versioned way? [i.e. protocol buffers, xml, etc]


ObjectOutputStream, which is fixed in its required fields and UID.

No it isn't. It requires a fixed serialVersionUID all right, but it has a lot of flexibility about how much versioning it can support - see the Versioning chapter of the Object Serialization Specification.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜