Uploaded image for project: 'JBoss Cache'
  1. JBoss Cache
  2. JBCACHE-1601

cache.getNode can delete data when using a passivation cache loader

    Details

    • Steps to Reproduce:
      Hide

      <?xml version="1.0" encoding="UTF-8"?>
      <jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.2">
      <eviction wakeUpInterval="1000">
      <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
      <property name="timeToLive" value="1000" />
      </default>
      </eviction>
      <loaders passivation="true" shared="false">
      <loader class="org.jboss.cache.loader.FileCacheLoader" async="false" fetchPersistentState="true"
      ignoreModifications="false">
      <properties>
      location=${java.io.tmpdir}/JBCACHE-1601
      </properties>
      </loader>
      </loaders>
      </jbosscache>

      CacheFactory factory = new DefaultCacheFactory();
      Cache cache = factory.createCache("cache.xml");

      cache.put ( fqn, "test", "data" );
      Thread.sleep ( 3000 ); // wait for eviction
      cache.getNode ( fqn );
      Thread.sleep ( 3000 ); // wait for eviction
      System.out.println ( cache.get ( fqn, "test" ) );

      Expected result: "test"
      Actual result: "null"

      Show
      <?xml version="1.0" encoding="UTF-8"?> <jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.2"> <eviction wakeUpInterval="1000"> <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm"> <property name="timeToLive" value="1000" /> </default> </eviction> <loaders passivation="true" shared="false"> <loader class="org.jboss.cache.loader.FileCacheLoader" async="false" fetchPersistentState="true" ignoreModifications="false"> <properties> location=${java.io.tmpdir}/ JBCACHE-1601 </properties> </loader> </loaders> </jbosscache> CacheFactory factory = new DefaultCacheFactory(); Cache cache = factory.createCache("cache.xml"); cache.put ( fqn, "test", "data" ); Thread.sleep ( 3000 ); // wait for eviction cache.getNode ( fqn ); Thread.sleep ( 3000 ); // wait for eviction System.out.println ( cache.get ( fqn, "test" ) ); Expected result: "test" Actual result: "null"
    • Affects:
      Release Notes

      Description

      When cache.getNode loads a passivated node, the data is not loaded, but it does trigger an eviction event.
      When eviction then passivates the node again, the data is overwritten.

      Similar to JBCACHE-825.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  dereed Dennis Reed
                  Reporter:
                  dereed Dennis Reed
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: