2 Replies Latest reply on Mar 2, 2007 4:44 AM by kevinstembridge


    kevinstembridge Newbie

      Hi all,
      I'm having trouble getting an eviction policy to work properly for objects that are not in a top-level tree node.

      I'm using JBossCache as the 2nd-level cache for Hibernate. So, for example, if I am caching an object called my.package.MyClass, it ends up in a cache region called /my/package/MyClass. To set up an eviction policy for this region I am using the following config:

       <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
       <!-- Specific eviction policy configurations. This is LRU -->
       <attribute name="EvictionPolicyConfig">
       <attribute name="wakeUpIntervalSeconds">5</attribute>
       <!-- Cache wide default -->
       <region name="/_default_">
       <attribute name="maxNodes">5000</attribute>
       <attribute name="timeToLiveSeconds">30</attribute>
       <region name="/my/package/MyClass" >
       <attribute name="maxNodes">10000</attribute>
       <attribute name="timeToLiveSeconds">10</attribute>
       <attribute name="maxAgeSeconds">10</attribute>

      But the result I'm seeing is that the eviction policy for the specific region is not applied.

      However, things work fine if I tell Hibernate to store objects in a top-level region (i.e. not nested) and provide an eviction policy for that region.

      BTW, using JBossCache 1.4 with Hibernate 3.2.0 in JBoss 4.0.5.

      Any help is much appreciated.