2 Replies Latest reply on Jun 6, 2013 2:04 PM by shadowcreeper

    Infinispan 5.2 cache stores seem to remove stored entities early

    shadowcreeper Apprentice

      I have an Infinispan (5.2.6.Final) cache running in JBoss (7.1.2.Final).

       

      When I add entities to cache with put(id,entity,maxIdle,timeUnit,lifespan,timeUnit), give them a maxIdle of 1 minute and keep retrieving them from the cache before the idle timeout (every 50 seconds), they will stay in the cache for several minutes (as long as I have tested), but they get removed from the store 1 minute after they were created.

       

      I can reproduce this with +stringKeyedJdbcStore+ and +fileStore+.

       

      I understand the store not knowing when they were last retrieved since writes are minimal, but all the documentation claims the store and cache should remain in sync.

       

      I'm hoping it's just a configuration issue.

       

      Here is my infinispan config file:

       

      {code:xml}<infinispan xmlns="urn:infinispan:config:5.2"

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

                  xmlns:jdbc="urn:infinispan:config:jdbc:5.2"

                  xsi:schemaLocation="urn:infinispan:config:5.2

                                      http://www.infinispan.org/schemas/infinispan-config-5.2.xsd

                                      urn:infinispan:config:jdbc:5.2

                                      http://www.infinispan.org/schemas/infinispan-cachestore-jdbc-config-5.2.xsd">

         <global>

            <globalJmxStatistics

                  enabled="true"

                  cacheManagerName="CACHE_TEST"

                  jmxDomain="CACHE_TEST" />

       

            <transport

                  clusterName="CACHE_TEST"

                  distributedSyncTimeout="10000" />

         </global>

       

         <default>

            <jmxStatistics enabled="true" />

       

            <!-- Use a replicated cluster with synchronized data transfers -->

            <clustering mode="repl">

               <sync replTimeout="10000" />

               <stateTransfer timeout="10000" />

            </clustering>

       

            <transaction

                  transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossTransactionManagerLookup"

                  transactionMode="TRANSACTIONAL"

                  autoCommit="false"

                  lockingMode="OPTIMISTIC"

                  useSynchronization="true"

                  reaperWakeUpInterval="1000" />

            <locking isolationLevel="REPEATABLE_READ" />

       

            <eviction maxEntries="10000" strategy="LRU" />

            <expiration

                  maxIdle="-1"

                  lifespan="86400000"

                  reaperEnabled="true"

                  wakeUpInterval="1000" />

       

            <indexing enabled="true" indexLocalOnly="false">

               <properties>

                  <property name="default.directory_provider" value="ram" />

               </properties>

            </indexing>

       

      <!--

            <loaders passivation="false" shared="false" preload="true">

               <fileStore  purgeOnStartup="false" location="${java.io.tmpdir}" />

            </loaders>

      -->

            <loaders passivation="false" shared="true" preload="true">

               <jdbc:stringKeyedJdbcStore

                     fetchPersistentState="false"

                     ignoreModifications="false"

                     purgeOnStartup="false">

                  <jdbc:dataSource jndiUrl="java:jboss/datasources/DefaultDS" />

                  <jdbc:stringKeyedTable

                        dropOnExit="false"

                        createOnStart="true"

                        prefix="ISPN_STRING_TABLE">

                     <jdbc:idColumn name="ID" type="VARCHAR(255)" />

                     <jdbc:dataColumn name="DATA" type="VARBINARY(8000)" />

                     <jdbc:timestampColumn name="TIMESTAMP" type="BIGINT" />

                  </jdbc:stringKeyedTable>

               </jdbc:stringKeyedJdbcStore>

            </loaders>

         </default>

      </infinispan>{code}