0 Replies Latest reply on Nov 8, 2006 6:37 PM by Jeffrey Ai

    Cannot evict node if the node is put into cache with FQN gen

    Jeffrey Ai Newbie

      Hi there,

      We are using Jboss Cache 1.4.0.GA and are running into an eviction problem. It seems any node put into cache with Long-type FQN cannot be evicted.
      The code is like below.

      Fqn BASE_FQN = new Fqn("xx/product");
      final Fqn fqn = new Fqn(BASE_FQN, Long.valueOf(productUid));
      cache.put(fqn, product);
      



      We tried to trace into the TreeCache.java.
      It seems the code always trying to remove a child node by giving a String key.
      Here are the code section I quoted from the "_remove" method in TreeCache.java.
       // remove subtree from parent
       parent_node.removeChild(n.getName());
      



      If we change the code to use String, then eviction works fine.
      final Fqn fqn = new Fqn(BASE_FQN, String.valueOf(productUid));
      


      Do I missed something or is this a bug.
      BTW, Our eviction strategy is defined as below:
       <!-- Name of the eviction policy class. -->
       <attribute name="EvictionPolicyClass">
       org.jboss.cache.eviction.LRUPolicy
       </attribute>
      
       <!-- Specific eviction policy configurations. This is LRU -->
       <attribute name="EvictionPolicyConfig">
       <config>
       <!-- This is the interval (in seconds) to process the node events and also to perform
       sweeping for the size limit and age-out nodes. -->
       <attribute name="wakeUpIntervalSeconds">10</attribute>
      
       <!-- Cache wide default -->
       <region name="/_default_">
       <!-- This is the maximum number of nodes allowed in this region. Any integer less than or equal to 0
       will throw an exception when the policy provider is being configured for use. -->
       <attribute name="maxNodes">50000</attribute>
      
       <!-- Time to idle (in seconds) before the node is swept away. 0 denotes no limit. -->
       <attribute name="timeToLiveSeconds">600</attribute>
      
       <!-- Time an object should exist in TreeCache (in seconds) regardless of idle time before the
       node is swept away. 0 denotes no limit. -->
       <attribute name="maxAgeSeconds">3600</attribute>
       </region>
       </config>
       </attribute>
      


      Thanks in advance.