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

[GSS] (7.0.z) Unable to reference a specific cache configured in standalone*.xml or domain*.xml

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 7.0.3.GA
    • Hibernate
    • None
    • Hide
      1. Copy the invalidation-cache config (see description) into the standalone-ha.xml (e.g. right below the "entity" cache)
      2. Start JBoss using bin/standalone.sh -c standalone-ha.xml
      3. Copy the attached jboss.eap-1.0-SNAPSHOT.jar into <JBOSS_HOME>/standalone/deployments
      4. Connect to the server with JConsole and navigate to jboss.infinispan->Cache (see the attached snapshot from JConsole connected to an EAP 7.0 CP03 server)
      Show
      Copy the invalidation-cache config (see description) into the standalone-ha.xml (e.g. right below the "entity" cache) Start JBoss using bin/standalone.sh -c standalone-ha.xml Copy the attached jboss.eap-1.0-SNAPSHOT.jar into <JBOSS_HOME>/standalone/deployments Connect to the server with JConsole and navigate to jboss.infinispan->Cache (see the attached snapshot from JConsole connected to an EAP 7.0 CP03 server)

      Trying to configure invalidation-cache regions with different expiration lifespans.

      I started with the following in standalone-ha.xml:

          <invalidation-cache name="entity-invalidation" mode="SYNC">
              <transaction mode="NON_XA"/>
              <eviction strategy="LRU" max-entries="10000"/>
              <expiration lifespan="300000" max-idle="120000"/> <!-- 5 minute max, 2 minute idle -->
          </invalidation-cache>
      

      I added the following property in persistence.xml:

          <property name="hibernate.cache.infinispan.jboss.eap-1.0-SNAPSHOT.jar#jboss-eap-hibernate.invalidation.cfg" value="entity-invalidation"/>
      

      And in my entities, I used:

      @Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL, region="invalidation")
      

      Using JConsole, I see a region named "jboss.eap-1.0-SNAPSHOT.jar#jboss-eap-hibernate.invalidation(local)" has been created and find that my entities are put there in testing. But, the configuration from standalone-ha.xml isn't picked up as JConsole shows that maxIdle == -1 and lifespan == -1 whereas I expect to see 120000 and 300000, respectively. Also, this should not be a "local" cache.

        1. eap-7.0.3-jconsole.png
          161 kB
          Stephen Fikes

              pferraro@redhat.com Paul Ferraro
              rhn-support-sfikes Stephen Fikes (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: