1 Reply Latest reply on Oct 7, 2014 11:54 PM by rahul.daga

    Using a different infinispan cachemanager/container (other than hibernate) for 2LC

    rahul.daga

      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