-
Bug
-
Resolution: Done
-
Major
-
11.0.0.Final, 10.1.8.Final
-
None
org.infinispan.jcache.remote.JCacheManager creates two RemoteCacheManager instances, one with forceReturnValues(false) and one with forceReturnValues(true). This is wasteful, because each RemoteCacheManager will create its own server connections and threads.
It also breaks JCache listeners when the user explicitly sets the marshaller to org.infinispan.commons.marshall.ProtoStreamMarshaller, because JCacheManager registers the KeyValueWithPrevious marshaller (from GlobalContextInitializer) in only one of the managers.
The test suites work by accident:
- The jcache/remote test suite doesn't configure a marshaller, instead ConfigurationBuilder.build() creates a ProtostreamMarshaller instance (because jboss-marshalling is not on the classpath) and the next Configuration.build() call uses *the same ProtostreamMarshaller instance*, so the {{RemoteCacheManager}}s share the serialization context.
- The jcache/tck-runner-remote test suite has jboss-marshalling on the classpath from the server/runtime dependency, so it uses GenericJBossMarshaller.