0 Replies Latest reply on Jun 20, 2019 6:49 AM by Fabrizio Stellato

    ehcache odd region name when deploying web app to JBoss

    Fabrizio Stellato Newbie

      I have a web application with hibernate and ehcache so configured on ehcache.xml under EJB:

       

      <ehcache name="EcCache">
        
      <defaultCache
        maxElementsInMemory
      ="10000"
        eternal
      ="false"
        overflowToDisk
      ="false"
        diskSpoolBufferSizeMB
      ="30"
        maxElementsOnDisk
      ="10000000"
        diskPersistent
      ="false"
        memoryStoreEvictionPolicy
      ="LRU"
        copyOnRead
      ="true"/>

        
      <cache name="myconfiguration"
        maxElementsInMemory
      ="10000"
        eternal
      ="false"
        overflowToDisk
      ="false"
        diskPersistent
      ="false"
        memoryStoreEvictionPolicy
      ="LRU"
        copyOnRead
      ="true">
        
      </cache>

       

      My entities are so configured:

       

      @Cacheable

      @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_ONLY, region = "myconfiguration")

      @Entity

      @Table(name = "MY_TABLE_NAME")

      public class Article implements Serializable {

       

      When I deploy my web app on AS, however region caches are so named:

       

      "persistence.unit:unitName=myear.ear/ejbs-version.jar#persistenceunitname.myconfiguration"

       

      How I can deploy my webapp in order to expose correct region name ?