Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-2658

Infinispan caches non transactional despite transactional cache mode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.0.0.ER5
    • 7.0.0.ER3
    • Clustering
    • None
    • Compatibility/Configuration
    • Hide

      Creating cache programmatically might be a workaround.

      Show
      Creating cache programmatically might be a workaround.
    • Hide

      Declare a cache-container and a cache like this:
      {{<cache-container name="example">
      <local-cache name="localfullxa">
      <transaction mode="FULL_XA"/>
      </local-cache>
      </cache-container>}}

      Inject the cache container into a bean, obtain the advanced cache instance and print the transaction mode:

      {{@Resource(lookup = "java:jboss/infinispan/container/example")
      private CacheContainer container;
      ...
      Cache<String, String> cache = container.getCache("localfullxa");
      AdvancedCache<String, String> ac = cache.getAdvancedCache();
      log.warn("tx mode is " + ac.getCacheConfiguration().transaction().transactionMode());}}

      Expected result: mode to be TRANSACTIONAL (this is the case on WildFly9 and AS 7)
      Actual result: mode is NON_TRANSACTIONAL

      Show
      Declare a cache-container and a cache like this: {{<cache-container name="example"> <local-cache name="localfullxa"> <transaction mode="FULL_XA"/> </local-cache> </cache-container>}} Inject the cache container into a bean, obtain the advanced cache instance and print the transaction mode: {{@Resource(lookup = "java:jboss/infinispan/container/example") private CacheContainer container; ... Cache<String, String> cache = container.getCache("localfullxa"); AdvancedCache<String, String> ac = cache.getAdvancedCache(); log.warn("tx mode is " + ac.getCacheConfiguration().transaction().transactionMode());}} Expected result: mode to be TRANSACTIONAL (this is the case on WildFly9 and AS 7) Actual result: mode is NON_TRANSACTIONAL

      Local Infinispan caches declared in standalone.xml are no longer set as transactional even if a transactional mode is selected.

      This prevents creation of atomic maps using AtomicMapLookup as that specifically checks if the cache is transactional (throws java.lang.IllegalStateException: AtomicMap needs a transactional cache.)

      Possibly caused by issue WFLY-5327.

            pferraro@redhat.com Paul Ferraro
            pferraro@redhat.com Paul Ferraro
            Ladislav Thon Ladislav Thon
            Ladislav Thon Ladislav Thon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: