Uploaded image for project: 'Commons JCS'
  1. Commons JCS
  2. JCS-45

Partial Key removal misses purgatory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • jcs-1.3
    • jcs-2.0-beta-2
    • Indexed Disk Cache
    • None

    Description

      The documentation explains that it is possible to do "hierarchical deletion" using keys with colon separators:

      <http://jakarta.apache.org/jcs/faq.html#hierarchical-removal>

      I would like this feature, but it appears to be broken when DiskUsagePatternName is specified as UPDATE. I am using Java 1.6 on Windows.

      Below is a short test program that illustrates the behavior. When I run this program without changes, it prints out "OK" two times. When I uncomment the setProperty() line in makeProps() and re-run the program, it prints out "Error!" twice.

      ---------------------------
      import java.util.Properties;
      import org.apache.jcs.JCS;
      import org.apache.jcs.engine.control.CompositeCacheManager;

      public class JcsProblem {

      private static Properties makeProps()

      { Properties props = new Properties(); props.setProperty("jcs.region.foo", "DC"); props.setProperty("jcs.region.foo.cacheattributes", "org.apache.jcs.engine.CompositeCacheAttributes"); props.setProperty("jcs.region.foo.MemoryCacheName", "org.apache.jcs.engine.memory.lru.LRUMemoryCache"); // Uncomment the following line to make hierarchical removal not work. // props.setProperty("jcs.region.foo.cacheattributes.DiskUsagePatternName", "UPDATE"); props.setProperty("jcs.auxiliary.DC", "org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory"); props.setProperty("jcs.auxiliary.DC.attributes", "org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes"); props.setProperty("jcs.auxiliary.DC.attributes.DiskPath", System.getProperty("user.dir")); return props; }

      public static void main(String[] args) throws Exception

      { CompositeCacheManager ccm = CompositeCacheManager.getUnconfiguredInstance(); ccm.configure(makeProps()); JCS cache = JCS.getInstance("foo"); cache.put("foo:bar:baz", "one"); cache.put("foo:bar:qux", "two"); cache.put("bar:quxx", "three"); cache.remove("foo:bar:"); System.out.println(((cache.get("foo:bar:baz") == null) ? "OK" : "Error!")); System.out.println(((cache.get("foo:bar:qux") == null) ? "OK" : "Error!")); }

      }

      Attachments

        Issue Links

          Activity

            People

              asmuts Aaron Smuts
              johnson@hawaii.edu Philip Johnson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: