1 Reply Latest reply on Sep 30, 2015 2:20 PM by galder.zamarreno

    Creating new caches with default-cache properties using JCache APIs

    akumar3

      Hi,

       

      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"

          xmlns="urn:infinispan:config:7.0">

          <cache-container name="testCacheContainer"

              default-cache="defaultCache">

              <local-cache name="defaultCache">

                  <eviction max-entries="32" />

              </local-cache>

              <local-cache name="existentCache">

              </local-cache>

          </cache-container>

      </infinispan>

       

      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.