[jboss-jira] [JBoss JIRA] (WFLY-13693) Custom Infinispan cache regions fail when using legacy (non-JPA) Hibernate configuration

Stephen Fikes (Jira) issues at jboss.org
Thu Jul 23 12:42:27 EDT 2020


Stephen Fikes created WFLY-13693:
------------------------------------

             Summary: Custom Infinispan cache regions fail when using legacy (non-JPA) Hibernate configuration
                 Key: WFLY-13693
                 URL: https://issues.redhat.com/browse/WFLY-13693
             Project: WildFly
          Issue Type: Bug
          Components: JPA / Hibernate
    Affects Versions: 14.0.0.Final
            Reporter: Stephen Fikes
            Assignee: Scott Marlow


A custom cache template is defined in the "hibernate" cache container in the {{standalone.xml}}
{code:java}
                <local-cache name="entities.custom-cache">
                    <transaction mode="NONE"/>
                    <object-memory size="10"/>
                </local-cache>
{code}
In the legacy {{hibernate.cfg.xml}} this is associated with a named cache region.
{code:java}
                <property name="hibernate.cache.region_prefix">entities</property>
                <property name="hibernate.cache.infinispan.entities.custom-cache.cfg">entities.custom-cache</property>
                <property name="hibernate.cache.use_second_level_cache">true</property>
{code}
The cache region is then referenced in an entity annotation:
{code:java}
@Entity
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE, region="custom-cache")
public class Employee {
    ...
}
{code}
At deployment, an exception is logged:

{noformat}
... HHH025007: Custom cache configuration 'entities.custom-cache' was requested for region entities.custom-cache but it was not found - using configuration by type (entity).
{noformat}

This same approach (but using transactional caching) worked in Wildfly 11.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the jboss-jira mailing list