cacheMinutes settings no longer work

Description

The cacheMinutes settings in alias, authz, site and user no longer have any effect, i.e. sakai.properties settings such as:

cacheMinutes@org.sakaiproject.site.api.SiteService = 3

do not do anything.

These used to set the lifetime of a cached object, but the memory service no longer supports the duration argument to cache put methods (c/f https://sakaiproject.atlassian.net/browse/SAK-11440#icft=SAK-11440)

components.xml entries and related setters for these need to be removed. The TTLs of the underlying memory/ehcache caches should be made configurable by creating bean entries for them.

Also the documentation needs to be updated, e.g. the reference sakai.properties in

reference/docs/sakai.properties

Attachments

2
  • 18 Feb 2009, 09:10 AM
  • 18 Feb 2009, 09:10 AM

Activity

Aaron Zeckoski July 1, 2010 at 3:48 AM

Other than the lack of a prefix for the caches (e.g. memory.org.sakaiproject.user.api.UserDirectoryService.callCache=timeToLiveSeconds=7200,timeToIdleSeconds=7200) this patch looks good. Add a required prefix and we should be good.

Jean-François Lévêque June 24, 2010 at 8:08 AM

What's the status for this issue in Sakai 2.7.0 / trunk?

Matthew Buckett October 20, 2009 at 7:06 AM

Just to follow up on Ray's point, you can configure the caches that have an EhCacheFactoryBean defined, the examples are in:

/sakai-kernel-component/src/main/webapp/WEB-INF/db-components.xml

and an example of one of these beans is:

<bean id="db.cache.SAKAI_SITE_GROUP_PROPERTY"
class="org.springframework.cache.ehcache.EhCacheFactoryBean">
<property name="cacheManager" ref="org.sakaiproject.memory.api.MemoryService.cacheManager" />
<property name="cacheName" value="org.sakaiproject.db.BaseDbFlatStorage.SAKAI_SITE_GROUP_PROPERTY" />
</bean>

at the moment not all the Sakai caches (from kernel trunk) are configurable in this way.

org.sakaiproject.springframework.orm.hibernate.L2Cache
db.cache.SAKAI_ALIAS_PROPERTY
db.cache.SAKAI_SITE_PROPERTY
db.cache.SAKAI_SITE_PAGE_PROPERTY
db.cache.SAKAI_REALM_PROPERTY
db.cache.SAKAI_SITE_GROUP_PROPERTY
db.cache.SAKAI_USER_PROPERTY
org.sakaiproject.event.api.UsageSessionService.recentUserRefresh
org.sakaiproject.user.api.AuthenticationManager.cache
org.sakaiproject.user.api.UserDirectoryService.cache

Another problem with this method of configuration is that in most cases the cache name doesn't match the bean ID so someone wanting to change the setting has to lookup the source to the cache definition to find the bean ID.

Matthew Buckett February 18, 2009 at 9:12 AM

Forgot to say, this is actually a patch against our 2.5.x branch, but you should get the idea of what I have changed. If someone will look at merging it I'll generate a patch based off the stock sakai 2.5.x branch (and then it should probably go to k1 too).

Matthew Buckett February 18, 2009 at 9:10 AM

I've just been looking at fixing this in user.
Attached are patches for /user /memory.

/user patch:
Remove old configuration properties.
Also change getCache to getIdEidCache to make it clearer what is it caching.

/memory patch:
Allow cache config from sakai.properties
If you have a sakai property with the name of the cache you can then have the cache configuration of something like "timeToLiveSeconds=20,timeToIdleSeconds=10"

So with these patches you can have ehcache configuration in you sakai.properties:

  1. Set the user cache to keep things around for an hour.
    org.sakaiproject.user.api.UserDirectoryService.callCache=timeToLiveSeconds=7200,timeToIdleSeconds=7200

Duplicate

Details

Priority

Affects versions

Assignee

Reporter

Created July 31, 2008 at 1:31 AM
Updated June 17, 2012 at 9:09 AM
Resolved December 27, 2010 at 3:17 PM

Flag notifications