[Building Sakai] cache settings in webapp applicationcontext are not working

Steve Swinsburg steve.swinsburg at gmail.com
Mon Jun 6 23:58:16 PDT 2011


Hi all,

I have a standalone webapp (no component, API etc) and am leveraging the Sakai MemoryService to add a cache into my app. The cache itself is working fine but the settings I define in my application context are not. In my application context I have:

<!-- cache: ttl=12 hours -->
    <bean id="my_bean_id"
        class="org.springframework.cache.ehcache.EhCacheFactoryBean">
        <property name="cacheManager">
            <ref bean="org.sakaiproject.memory.api.MemoryService.cacheManager"/>
        </property>
        <property name="cacheName">
            <value>my_cache_name</value>
        </property>
        <property name="maxElementsInMemory" value="1000" />
        <property name="diskPersistent" value="false" />
        <property name="eternal" value="false" />
        <property name="timeToLive" value="43200" />
        <property name="timeToIdle" value="43200" />
    </bean>


ie it is setup with a TTL of 12 hours (43200 seconds).

In the Memory tool within Sakai I see it registered ok, however the TTL is back to the default of 5 minutes:

[ name = my_cache_name status = STATUS_ALIVE eternal = false overflowToDisk = false maxElementsInMemory = 10000 maxElementsOnDisk = 0 memoryStoreEvictionPolicy = LRU timeToLiveSeconds = 300 timeToIdleSeconds = 300 diskPersistent = false diskExpiryThreadIntervalSeconds = 120 cacheEventListeners: hitCount = 8 memoryStoreHitCount = 8 diskStoreHitCount = 0 missCountNotFound = 1 missCountExpired = 1 ]

Is it not possible to override the cache settings via my webapp's spring wiring?

In Profile2 the cache setup is done in the component and it works  so I'm thinking its only when the setup happens in the webapp. Can anyone confirm?

cheers,
Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20110607/16880a12/attachment.html 


More information about the sakai-dev mailing list