jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Johnson <john...@hawaii.edu>
Subject Possible bug: hierarchical deletion not working with DiskUsagePatternName=UPDATE
Date Tue, 10 Jun 2008 04:26:40 GMT
Greetings, all,

I suspect I have found a bug in JCS 1.3.  The documentation explains that it is possible 
to do "hierarchical deletion" using keys with colon separators:


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.  I would appreciate 
any guidance on how to work around this problem, or if I am doing something wrong. 

Philip Johnson

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");
    // Uncomment the following line to make hierarchical removal not work.
    // props.setProperty("jcs.region.foo.cacheattributes.DiskUsagePatternName", "UPDATE");
    return props;

  public static void main(String[] args) throws Exception {
    CompositeCacheManager ccm = CompositeCacheManager.getUnconfiguredInstance();
    JCS cache = JCS.getInstance("foo");
    cache.put("foo:bar:baz", "one");
    cache.put("foo:bar:qux", "two");
    cache.put("bar:quxx", "three");
    System.out.println(((cache.get("foo:bar:baz") == null) ? "OK" : "Error!"));
    System.out.println(((cache.get("foo:bar:qux") == null) ? "OK" : "Error!"));

To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org

View raw message