2 Replies Latest reply on Dec 11, 2019 10:21 AM by serg_732173

    is second level cache infinispan enabled for cluster in Wildfly 17.0.1.Final per default?

    serg_732173 Newbie

      How must entry <cache-container name="hibernate" module= "org.infinispan.hibernate-cache"> look out for cluster in standalone-full-ha.xml?

       

      What is default lifespan if it is not set in standalone-full-ha.xml?

       

      Thanks!

        • 1. Re: is second level cache infinispan enabled for cluster in Wildfly 17.0.1.Final per default?
          Paul Ferraro Master

          serg_732173  wrote:

           

          How must entry <cache-container name="hibernate" module= "org.infinispan.hibernate-cache"> look out for cluster in standalone-full-ha.xml?

          I don't understand the question - so I'll try to answer the question in the title of the post:  2nd level cache is not enabled by default.  To enable 2nd level cache for a given persistence unit, you need to add the following property to your persistence.xml:

           

           

          <?xml version="1.0" encoding="UTF-8"?>
          <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">

             <persistence-unit name="...">

                <!-- ... -->

                <properties>

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

                </properties>

             </persistence-unit>

          </persistence>

           

          More about that here: JPA Reference Guide - Latest WildFly Documentation - Project Documentation Editor

           

          serg_732173  wrote:

           

          What is default lifespan if it is not set in standalone-full-ha.xml?

           

          If unspecified, entries will remain in the cache indefinitely, or until a specified max-idle elapses.

          • 2. Re: is second level cache infinispan enabled for cluster in Wildfly 17.0.1.Final per default?
            serg_732173 Newbie

            i have meant - must standalone-full-ha.xml be modified for cluster (not just for a node)? there was info about necessity of configuration of "replicated-cache" in some links. thanks

            default entry in standalone-full-ha.xml:

             

            <cache-container module="org.infinispan.hibernate-cache" name="hibernate">

                 <transport lock-timeout="60000"/>

                 <local-cache name="local-query">

                      <object-memory size="10000"/>

                      <expiration max-idle="100000"/>

                 </local-cache>

                 <invalidation-cache name="entity">

                      <object-memory size="10000"/>

                      <expiration max-idle="100000"/>

                 </invalidation-cache>

                 <replicated-cache name="timestamps"/>

            </cache-container>