1 Reply Latest reply on Sep 30, 2015 2:20 PM by Galder Zamarreño

    Creating new caches with default-cache properties using JCache APIs

    Ajay Kumar Newbie



      Can we create new caches using javax.cache.CacheManager such that this cache will inherit properties from the default cache defined in infinispan configuration file?


      My infinispan configuration:

      <?xml version="1.0" encoding="UTF-8"?>

      <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="urn:infinispan:config:7.0 http://www.infinispan.org/schemas/infinispan-config-7.0.xsd"


          <cache-container name="testCacheContainer"


              <local-cache name="defaultCache">

                  <eviction max-entries="32" />


              <local-cache name="existentCache">





      Now following two caches has different 'max-entries' set (verified by putting around 100 values and then iterating through all elements in the cache):

      Cache existentCache = cacheManager.getCache("existentCache");

      Cache newCache = cacheManager.createCache("newCache", existentCache.getConfiguration(javax.cache.configuration.CompleteConfiguration.class));


      existentCache stores at max only 32 elements; whereas newCache does not seems to inherit this limit on cache size.