1 of 1 people found this helpful
You need to enable compatibility mode and provide appropriate datacontainer equivalence classes. Look at tristantarrant/infinispan-playground-embedded-hotrod · GitHub for a working example.
Thanks for reply..
But when I enable compatibility mode, I think I need to write and define marshaller for VO(Value Object) that inserted as a value.
Also Infinispan-server's standalone.xml and clustered.xml does not contain <compatibility enabled="true"/> and works fine.
Why should I enable compatibility mode? and if compatibility is necessary mode, can i enable it without marshaller?
You need compatibility mode because you are writing from embedded and reading from HotRod.
In Infinispan Server you are only accessing the data remotely over a single protocol and therefore you do not need to enable compatibility mode. Server does however enable datacontainer equivalence using the same class that is in my example.
As for the marshaller, you don't need to write your own: you can use the included GenericJBossMarshaller. Also, if you're using the "embedded server" approach, enabling compatibility mode will ensure the marshaller is applied to the data when it is being accessed over HotRod. In this case the embedded side will only see the "real" (unmarshalled) object.
Resolved this issue.
Configuration config = new org.infinispan.configuration.cache.ConfigurationBuilder()
.dataContainer().keyEquivalence(new AnyServerEquivalence()).valueEquivalence(new AnyServerEquivalence())
Special thanks @Tristan Tarrant.