This content has been marked as final.
Show 2 replies
-
1. Re: cache not flushed as often as expected
yangju Jul 19, 2008 6:14 PM (in response to yangju)Sorry the xml quoto was missing. It is
<region name="/_default_"> <!--0 means no limit --> <attribute name="maxNodes">0</attribute> <attribute name="timeToLiveSeconds">1800</attribute> <attribute name="maxAgeSeconds">1800</attribute> </region>
"yangju" wrote:
I am running jboss 4.2 and hibernate with jboss treecache (deployed as mbean) as hibernate cache provider. I have the following default region evict policy defined in the treecache-service.xml :
<attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
<region name="/_default_">
<!--0 means no limit -->
<attribute name="maxNodes">0</attribute>
<attribute name="timeToLiveSeconds">1800</attribute>
<attribute name="maxAgeSeconds">1800</attribute>
</region>
In my code I save my query cache into a region called "/myregion". However, I don't have region "/myregion" configured. I thought if myregion is not defined in treecache-service.xml, it falls back to _default_ region. So I expected that every 30 mins my cache is flushed. However, I found that the cache is flushed every 3 or 4 hours, not 30 mins as specified in the _default_ region.
Do I have to define myregion? Doesn't treecache uses default cache policy if it cannot fine myregion?
Thanks.
<region name="/_default_">
<!--0 means no limit -->
<attribute name="maxNodes">0</attribute>
<attribute name="timeToLiveSeconds">1800</attribute>
<attribute name="maxAgeSeconds">1800</attribute>
</region> -
2. Re: cache not flushed as often as expected
manik Jul 22, 2008 5:41 AM (in response to yangju)No, it should fall back t the default region. If you switch on your logging, you should see the eviction thread kick in and you can monitor what it does.