6 Replies Latest reply on Jul 6, 2018 10:47 AM by pferraro

    WildFly 12 & 13 - Requesting TRANSACTIONAL cache concurrency strategy but the cache is not configured as transactional.

    florin.spatar

      Apparently defect [WFLY-9530] Requesting TRANSACTIONAL cache concurrency strategy but the cache is not configured as transactional. - JBos…  still happens in both WildFly 12 & 13, but in a slightly different configuration.

      See details in my last comment on the defect [WFLY-9530] Requesting TRANSACTIONAL cache concurrency strategy but the cache is not configured as transactional. - JBos…

       

      pferraro could you please confirm? Should we reopen the defect or submit a new one?

       

      Thank you,

      Florin Spatar

        • 1. Re: WildFly 12 & 13 - Requesting TRANSACTIONAL cache concurrency strategy but the cache is not configured as transactional.
          pferraro

          If configured correctly, this should be fixed. Can you paste your persistence.xml or hibernate.cfg.xml?

          • 2. Re: WildFly 12 & 13 - Requesting TRANSACTIONAL cache concurrency strategy but the cache is not configured as transactional.
            florin.spatar

            I added all the details on the linked wildfly issue [WFLY-9530] Requesting TRANSACTIONAL cache concurrency strategy but the cache is not configured as transactional. - JBos…

             

             

            Apparently this still happens in WildFly 12, but in a slightly different configuration:
            I don't use hibernate directly, but through JPA. In `persistence.xml` I have the following:

                        <property name="hibernate.cache.infinispan.ejb-embedded-server-4.0-SNAPSHOT.jar#embedded_test.embedded_test.memory.size" value="100000"/> 

            And the WARN is the same:

            16:17:44,696 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 63) WFLYCLINF0002: Started ejb-embedded-server-4.0-SNAPSHOT.jar#embedded_test.embedded_test cache from hibernate container
            16:17:44,697 WARN  [org.infinispan.hibernate.cache.impl.BaseRegion] (ServerService Thread Pool -- 63) HHH025012: Requesting TRANSACTIONAL cache concurrency strategy but the cache is not configured as transactional.
            16:17:44,706 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 63) WFLYCLINF0002: Started ejb-embedded-server-4.0-SNAPSHOT.jar#embedded_test.embedded_test-pending-puts cache from hibernate container
            16:17:44,748 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 63) WFLYCLINF0002: Started ejb-embedded-server-4.0-SNAPSHOT.jar#embedded_test.embedded_test_collections cache from hibernate container
            16:17:44,751 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 63) WFLYCLINF0002: Started ejb-embedded-server-4.0-SNAPSHOT.jar#embedded_test.embedded_test_collections-pending-puts cache from hibernate container 

            Apparently if you try to configure anything on a cache region, it will inherit a NON_TRANSACTIONAL configuration.

            PS: the issue also reproduces in WildFly 13

            WARN  [org.infinispan.hibernate.cache.v51.impl.BaseRegion] (ServerService Thread Pool -- 72) HHH025012: Requesting TRANSACTIONAL cache concurrency strategy but the cache is not configured as transactional. 
            • 3. Re: WildFly 12 & 13 - Requesting TRANSACTIONAL cache concurrency strategy but the cache is not configured as transactional.
              florin.spatar

              I managed to workaround the issue by configuring the cache in standalone-full.xml and refer it from persistence.xml.

               

              persistence.xml changes

              -  <property name="hibernate.cache.infinispan.main.ear#shared.shared.eviction.max_entries" value="250000"/>

              + <property name="hibernate.cache.infinispan.main.ear#shared.shared.cfg" value="shared"/>

               

              in standalone-full.xml I added the following under <cache-container name="hibernate" module="org.infinispan.hibernate-cache">

              <local-cache name="shared">

                  <binary-memory size="250000" eviction-type="COUNT"/>

                  <transaction mode="NON_XA" locking="OPTIMISTIC"/>

              </local-cache>

              • 4. Re: WildFly 12 & 13 - Requesting TRANSACTIONAL cache concurrency strategy but the cache is not configured as transactional.
                pferraro

                So it appears that "eviction.max_entries" (which is the deprecated equivalent of "memory.size") does not correct inherit the configuration of the default entity region, correct?

                 

                N.B. binary-memory doesn't make sense for the JPA 2nd level cache use case.  Why add unnecessary serialization/deserialization costs per access with no benefits?

                • 5. Re: WildFly 12 & 13 - Requesting TRANSACTIONAL cache concurrency strategy but the cache is not configured as transactional.
                  florin.spatar

                  Correct, but neither "memory.size" inherits the default configuration, as you can see in my previous example with embedded_test.embedded_test.memory.size.

                   

                  I think the problem is more generic: any tweak in persistence.xml on a cache region will not inherit the configuration of the default entity region.

                   

                  Regarding the N.B., I will go ahead and change <binary-memory size="10000" eviction-type="COUNT"/> with <object-memory size="10000"/>.

                  Just one question: The WildFly 13.0 Model Reference documents the size attribute as "Eviction threshold, as defined by the eviction-type", but object-memory doesn't have eviction-type attribute. From the Infinispan documentation, my understanding is that "Only COUNT eviction type is supported" for object-memory. So, the size attribute is the number of objects, correct? Maybe the WildFly Model Reference could be updated for this size attribute.

                  • 6. Re: WildFly 12 & 13 - Requesting TRANSACTIONAL cache concurrency strategy but the cache is not configured as transactional.
                    pferraro

                    florin.spatar  wrote:

                     

                    Correct, but neither "memory.size" inherits the default configuration, as you can see in my previous example with embedded_test.embedded_test.memory.size.

                    As of Infinispan 9.0, caches no longer inherit from a "default cache". See:

                    ISPN-7066 Drop default cache inheritance · infinispan/infinispan@ded4d69 · GitHub

                     

                    However, caches defined by Infinispan subsystem in WF *never* inherited configuration from the default-cache.  The default-cache merely defines the cache returned via BasicCacheContainer.getCache().  Infinispan 9.0's new semantics merely matches the behavior already used by WF.

                     

                    I think the problem is more generic: any tweak in persistence.xml on a cache region will not inherit the configuration of the default entity region.

                    That may well be a genuine bug.  Can you file a jira?

                     

                    Just one question: The WildFly 13.0 Model Reference documents the size attribute as "Eviction threshold, as defined by the eviction-type", but object-memory doesn't have eviction-type attribute. From the Infinispan documentation, my understanding is that "Only COUNT eviction type is supported" for object-memory. So, the size attribute is the number of objects, correct? Maybe the WildFly Model Reference could be updated for this size attribute.

                    The documentation is admittedly confusing, and needs to be fixed. The size attribute is common to all memory resources (i.e. object vs binary vs off-heap).  However, eviction-type, is common only to memory=binary and memory=off-heap.  This means that, for memory=object, size always means the number of cache entries.

                     

                    Thanks for pointing this out.