We rely on Wildly 8.2.0.Final as this does not work any more by 10.0.0.Final and above. See [WFLY-6596] WrongClassException when using infinispan as remote-store for hibernate entity cache - JBoss Issue Tracker . Because the ticket is ignored for the last months I think our way is not the right one to go.
The issue has not been assigned, probably because the component hasn't been set at the creation time letting Jira auto-assign to the right person, fixed now.
Thank you, Radoslav!
Thanks for posting this here, where more people will see it. This is an important use case that I know is desired to have working. I'm not exactly sure of where to look and am too busy currently to try the test case. I'd like to better understand why the problem is occurring. I'm curious if the org.hibernate.WrongClassException cause could be in Hibernate ORM or remote Infinispan cache.
I know that Hibernate has TRACE logging and Infinispan does as well but I'm not sure if either has TRACE logging that would help identify the cause of this problem. sebersole can you look at the details in https://issues.jboss.org/browse/WFLY-6596 and let us know what the likely cause is?
Gunther v. Wolffersdorff wrote:
But some things doesn't work optimal:
We have to configure a cache also in the Wildly Cluster (max-entries cannot be zero, local-cache isn't an option too).
So as a result we get a Wildly cache cluster, holding only some entries and the Infinispan cache cluster as main cache.
Using a local cache would result in stale reads on failover. You must use an invalidation-cache with this configuration. The WF cluster is required to broadcast invalidation messages when an entry in the local cache is updated. I'm not sure why you would want to eliminate this cache layer - as it will be a couple orders of magnitude faster than a remote infinispan cache alone.
We rely on Wildly 8.2.0.Final as this does not work any more by 10.0.0.Final and above.
Because the ticket is ignored for the last months I think our way is not the right one to go.
So the question is, what is the best way to separate AS and cache JVM from each other? Do you have other ideas?
How do you run a separated JPA entity cache?
The primary issue with your configuration is that WF's JPA 2LC will use a cache per region. If you have multiple regions, you must make sure they use a unique cache configuration - since otherwise they will try to share the same remote cache, and thus encounter key collisions (as hibernate does not use the region name to compose the cache key).
You must also make sure that your remote Infinispan cache uses storeAsBinary for both cache keys and values.