0 Replies Latest reply on Apr 25, 2011 11:55 AM by Andrig Miller

    Infinispan 2LC in AS 7 Beta3

    Andrig Miller Apprentice

      I have been trying to get a second-level cache configured to work with my application on AS 7 Beta 3.  There was a problem with the Hibernate module, in that it didn't contain the 2LC classes.  I added those, and changed the module definition to be dependent on the Infinispan module, and that all worked fine.


      I changed my persistence.xml (EJB 3 application), to add the following:


      <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.infinispan.JndiInfinispanRegionFactory"/>

                  <property name="hibernate.cache.infinispan.cachemanager" value="java:CacheManager/hibernate"/>

                  <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>

                  <property name="hibernate.cache.use_second_level_cache" value="true"/>

                  <property name="hibernate.cache.use_query_cache" value="false"/>         

                   <property name="hibernate.cache.use_minimal_puts" value="true"/>


      The application deploys up to the point of trying to find the cache, and it cannot find the cache in JNDI.


      In looking at JConsole, I can see the MBeans with the CacheManager's, and they are all created, but they are not bound in JNDI.


      What is the syntax in clustering-standalone.xml or domain.xml to give the JNDI name to bind to?  I assumed that I could add jndi-name="java:CacheManager/hibernate", but that gives a parse error.  I also am making an assumption about what the JNDI name would be, assuming it would be java:CacheManager with the cache name appended, which may or may not be correct.


      I figured that the JNDI binding would be automatic, but its not.


      In any case, any pointer in the right direction would be great.