0 Replies Latest reply on Sep 11, 2012 11:29 AM by arulanandsp

    Unable to override the evictionMaxEntries

    arulanandsp Newbie

      I am using Infinispan 4.2.1 and JBoss 4.2.3

      I have a default cache config set with the below and this is present in the jar which is used by multiple wars

       

      <bean id="cacheManager" class="org.infinispan.manager.DefaultCacheManager">

                          <constructor-arg ref="globalConfig" />

                          <constructor-arg ref="defaultConfig"  />

                          <constructor-arg value="true" >

                          </constructor-arg>

                </bean>

       

       

                <bean id="globalConfig" class="org.infinispan.config.GlobalConfiguration">

                          <property name="exposeGlobalJmxStatistics" value="true" />

                          <property name="allowDuplicateDomains" value="true" />

            </bean>

       

                <bean id="defaultConfig" class="org.infinispan.config.Configuration">

                          <property name="exposeJmxStatistics" value="true"/>

                          <property name="cacheModeString" value="LOCAL"/>

                          <property name="evictionWakeUpInterval" value="5000" />

                          <property name="evictionMaxEntries" value="1024" />

                          <property name="evictionStrategy" value="LIRS" />

                          <property name="evictionThreadPolicy" value="DEFAULT" />

                          <property name="useLockStriping" value="false" />

                          <property name="lockAcquisitionTimeout" value="1000" />

                          <property name="concurrencyLevel" value="100" />

                          <property name="expirationLifespan" value="3000" />

                          <property name="expirationMaxIdle" value="30000" />

                </bean>

       

      <bean id="testCache" factory-bean="cacheManager"

                          factory-method="getCache">

                          <constructor-arg value="testCache" />

                </bean>

       

       

      Is it possible to override the evictionMaxEntries at the war level.

      I tried overriding using the below

       

      <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">

          <property name="targetObject">

                          <bean factory-bean="testCache" factory-method="getConfiguration" />

             </property>

             <property name="targetMethod" value="applyOverrides" />

             <property name="arguments">

                          <ref local="cacheConfiguration"/>

             </property>

      </bean>

       

       

      <bean id="cacheConfiguration" class="org.infinispan.config.Configuration">

                <property name="evictionMaxEntries" value="20000" />

      </bean>

       

      but when I looked into the jmx-console, the number of entries is not going beyond 1024.

       

      Is this the right way or am I missing anything?