Per-region level 2 cache configuration is ignored in JBoss EAP

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7
    • 6
  • Hibernate
    • 5
    • 4
  • Infinispan
    • 8
    • 5

Issue

  • A custom cache template is configured in the [standalone*|domain].xml

        <local-cache name="entity-region-config1">
            ...
        </local-cache>
    
  • One or more cache regions are mapped to this configuration via the persistence.xml

    <persistence-unit name="MyPersistenceUnit" transaction-type="JTA">
        ...
        <properties>
            ...
            <!--
                 property name format: hibernate.cache.infinispan.<prefix>.<region>.cfg
                 prefix defaults to:   <deployment>#<unitname>, overridden by the hibernate.cache.region_prefix property
                 region defaults to:   <package.entity>, overridden via @Cache(... region="region-name")
            -->
            <property name="hibernate.cache.infinispan.abcd.org.myco.MyEntity.cfg" value="entity-region-config1"/>
            ...
        </properties>
    </persistence-unit>
    
  • Properties specified in the cache template are ignored and configuration seems to come from the hibernate cache container's entity template.

Resolution

Content from issues.jboss.org is not included.JBEAP-8221 is resolved in EAP 7.0 CP05 and later.

Root Cause

Diagnostic Steps

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.