Search code examples
hibernatejpawildflyhazelcast

Using Hazelcast IMDG as JPA second level cache in Wildfly (15)


Anybody knowing a way to use Hazelcast IMDG as JPA/Hibernate second level cache in Wildfly 15?

In my setup, Wildlfy is always using builtin Infinispan as soon as I activate 2nd level caching in my persistence.xml using

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

It seems that property hibernate.cache.region.factory_class isn't evaluated at all.


Solution

  • with

    <property name="wildfly.jpa.regionfactory" value="false" />
    

    it is possible to deactivate Wildfly's default behaviour of direct coupling to Infinispan. This makes it possible to use another 2nd level caching backend. (E.g. Hazelcast)

    Thanks to Martin in JBoss Developer Forum