Using a different infinispan cachemanager/container (other than hibernate) for 2LC
rahul.daga Oct 4, 2014 7:25 AMHey starksm64 or anyone else who cares,
It seems that if one wishes to use a different container than the 'hibernate' one it still ends up using the hibernate container. (AS 7.2.0.Final-redhat-8)
For example if we create a new container called 'jpa' as below and verify the cache container started up fine via logs/admin console.
<cache-container name="jpa" default-cache="local-query" start="EAGER" module="org.jboss.as.jpa.hibernate:4" jndi-name="java:jboss/infinispan/jpa"> <local-cache name="entity"> <transaction mode="NON_XA"/> <eviction strategy="LRU" max-entries="10000"/> <expiration lifespan="1800000"/> </local-cache> <local-cache name="local-query"> <transaction mode="NONE"/> <eviction strategy="LRU" max-entries="10000"/> <expiration max-idle="1000000"/> </local-cache> <local-cache name="timestamps"> <transaction mode="NONE"/> <eviction strategy="NONE"/> </local-cache> </cache-container>
and add the cachemanager reference in persistence.xml for 2LC
<property name="hibernate.cache.infinispan.cachemanager" value="java:jboss/infinispan/jpa" /> <property name="hibernate.cache.region.factory_class" value="org.jboss.as.jpa.hibernate4.infinispan.InfinispanRegionFactory" />
but it still uses the hibernate container.
INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 59) JBAS010281: Started example.war#com.example.blah cache from hibernate container
ordinarily this would be fine but I have need to use a different cache container for one of the apps and I cannot change the hibernate containers config. Appreciate any clues or alternate magic to achieve this..
Message was edited by: Rahul Daga - Reason: I could not post the below earlier but thanks to Radoslav Husar I can!
-
2pc-inifinispan.txt.zip 879 bytes