hibernate

Caching

Enabling Hibernate Caching in WildFly

To enable Second Level Caching for Hibernate in WildFly, add this property to your persistence.xml file:

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

You may also enable Query Caching with this property:

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

WildFly does not require you to define a Cache Provider when enabling Hibernate’s Second-Level Cache, as Infinispan is used by default. If you would like to use an alternative Cache Provider, however, you may do so with the hibernate.cache.provider_class property.


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow