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

Steve Swinsburg steve.swinsburg at gmail.com
Sun Jun 26 20:50:32 PDT 2011


Now that the conference is over, does anyone have input on the behaviour I'm seeing below?

We have some cache wiring in our webapp setup to use the org.sakaiproject.MemoryService, but it's not using any of the settings I define, only the cache name itself.

Any input would be appreciated.

thanks,
Steve


On 07/06/2011, at 4:58 PM, Steve Swinsburg wrote:

> 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/20110627/76e05a85/attachment.html 


More information about the sakai-dev mailing list