Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISPN-5180 Try standard serialization if unmarshalled entry still byte[] #3237

Closed
wants to merge 1 commit into from

Conversation

galderz
Copy link
Member

@galderz galderz commented Jan 27, 2015

It might not the ideal solution, but one that requires least amount of change.

Another alternative solutions might require HotRodTypeConverter to send back byte[] instances as-is, rather than trying to marshall them again (which is why you can still have a standard serialized object marshalled again with the marshaller).

Yet another alternative is to add a configuration flag in RemoteCacheManager to enable compatibility so that it works optimally when compatibility is enabled.

Yet, yet, another alternative is to have enforce that such use case requires a custom marshaller to be installed, but this shouldn't be required IMO to deal with Java standard serialization.

// to make the client behave in compatibility mode, and hence only
// try using standard serialization if compatibility is enabledd.
if (ret instanceof byte[]) {
try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream((byte[]) ret))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a quick check for the "magic" value at the beginning before attempting to read it via OIS ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea :) I'll resubmit

@galderz
Copy link
Member Author

galderz commented Jan 27, 2015

@tristantarrant Updated

@tristantarrant
Copy link
Member

Pushed, thanks

@galderz galderz deleted the t_5180 branch January 27, 2015 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants