Hi Adam,

The problem described below is already fixed in cocoon 2.1.9 [1]. Now, the component has new parameters to handle this problem:

eternal
timeToLiveSeconds
timeToIdleSeconds

See the new javadocs [2].

Best Regards,

Antonio Gallardo.

[1] http://issues.apache.org/jira/browse/COCOON-1683
[2] http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/store/impl/EHDefaultStore.html#parameterize(org.apache.avalon.framework.parameters.Parameters)

Adam Constabaris escribió:
As things stand (stood?) with Cocoon 2.1.8, the default EHCache implementation doesn't seem to offer much in the way of configurability; you can't specify your own ehcache configuration file via configuration, and there's not much you can do in cocoon.xconf either.

If I read the Cocoon source and the EHCache documentation correctly, nothing is ever expired from EHCache (the cache is eternal and timeToLiveSeconds on elements in the cache is 0, i.e. infinite).

The effect of all this is that unless you modify the source, you get a cache that basically fills up and never expires. I've had cache files pile up in excess of 1.5GB, which has created a bit of a disk space problem on the server. But I don't want to just change the configuration without finding out a little more about it.


here's the relevant bits in org.apache.cocoon.components.store.impl.EHDefaultStore:

private static final String CONFIG_FILE = "org/apache/cocoon/components/store/impl/ehcache.xml";

...

public void initialize() throws Exception {
URL configFileURL = Thread.currentThread().getContextClassLoader().getResource(CONFIG_FILE);
        this.cacheManager = CacheManager.create(configFileURL);
this.cache = new Cache(this.cacheName, this.maxObjects, this.overflowToDisk, true, 0, 0, true, 120);
        this.cacheManager.addCache(this.cache);
        this.storeJanitor.register(this);
}

So, in other words, it always pulls its configuration from the JAR (or in a deeply nested directory on the classpath) and lets you configure three values. The relevant snippet of the default configuration file shipped is:

    <defaultCache
        maxElementsInMemory="10000"
        eternal="true"
        timeToIdleSeconds="0"
        timeToLiveSeconds="0"
        overflowToDisk="true"
        diskPersistent="true"
        diskExpiryThreadIntervalSeconds="120"
        />


On the general assumption that all these things are the way they are for a reason, could anybody tell me what those reasons are (is Cocoon supposed to handle expiring things from the cache?)? Is there some way of more easily configuring EHCache at deploy time that I'm missing? If anybody has reconfigured by repackaging the config file and has experiences they can share, I'd love to hear 'em.

thanks!

AC


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to