0 Replies Latest reply on Apr 4, 2014 10:40 AM by godiedelrio

    Specific Hibernate entity cache configuration ignored in Hibernate-Infinispan integration

    godiedelrio

      Hi everyone.

      Does the region name specified in the mapping file of a persistent entity correspond to the cache with the same name in the infinispan config file? In other words, does the hibernate-infinispan integration apply the configuration of the cache declared in the infinispan config file that has the same name as the entity region declared in the mapping file? The config file we are working with is based on the infinispan configuration file shipped with Hibernate-Infinispan integration which comes with 3 predefined caches that correspond to the cacheable datatypes defined by Hibernate: entities/collections, queries and timestamps.

      For example, for the following mapping file:


      <?xml version="1.0"?>
      <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
      <hibernate-mapping>
         <class name="org.myself.EntityA" table="ENTITY_A">
            <cache region="EntityA-cache" usage="read-only"/>
      ...
      </hibernate-mapping>
      

       

      Does hibernate-infinispan integration build the entity region "EntityA-cache" using the following configuration declared in the infinispan configuration file?

       

         <namedCache name="EntityA-cache">
            <clustering mode="replication">
               <async/>
            </clustering>
            <locking isolationLevel="READ_COMMITTED" concurrencyLevel="1000"
                     lockAcquisitionTimeout="15000" useLockStriping="false"/>
            <eviction strategy="NONE"/>
         </namedCache>
      

       

      We've done some tests and it appears that the configuration of the specific cache is ignored and instead the configuration of the generic cache named "entity" (which is in the same infinispan configuration file as the specific cache) is used.

       

      We are using the following versions:

      Hibernate ORM 4.2.10.Final

      Infinispan core 5.3.0.Final