Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
Cache not flushed Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cache not flushed

    Hi all,

    I'm using the OSCache integration from SprindModules, and it really improves the performance of the app, but I can't get the cache to flush.

    Here goes an excerpt of the config:

    Code:
    	<bean id="baseDao"    class="org.springmodules.cache.interceptor.proxy.CacheProxyFactoryBean">
    	    <property name="cacheProviderFacade">
    		<ref local="cacheProvider" />
    	    </property>
    	    <property name="cachingAttributes">
    		<props>
    		     <prop key="obtenirTotesFasesProduccio">[cacheProfileId=cacheWheels]</prop>
    		</props>
    	    </property>
    	    <property name="cacheFlushAttributes">
    		<props>
    		    <prop key="actualitzarFase">[cacheProfileIds=cacheWheels][flushBeforeExecution=true]</prop>
    		</props>
    	    </property>
    	    <property name="target">
    		<ref bean="baseDaoTarget"/>
    	    </property>
    	</bean>
    ...the idea is to cache results from "obtenirTotesFasesProduccio", and flush before executing "actualitzarFase" in "baseDaoTarget".

    I've enable debugging:

    The first call gets cached:
    Code:
    2006-02-10 12:58:43,818 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - Initializing transaction synchronization
    2006-02-10 12:58:43,818 DEBUG [org.springmodules.cache.provider.AbstractCacheProviderFacadeImpl] - Method 'getFromCache(CacheKey, String)'. Argument 'cacheKey': 629|22072380
    2006-02-10 12:58:43,818 DEBUG [org.springmodules.cache.provider.AbstractCacheProviderFacadeImpl] - Method 'getCacheProfile(String)'. Argument 'cacheProfileId': cacheWheels
    2006-02-10 12:58:43,818 DEBUG [org.springmodules.cache.provider.AbstractCacheProviderFacadeImpl] - Method 'getCacheProfile(String)'. Variable 'cacheProfile': org.springmodules.cache.provider.oscache.OsCacheProfile@190b03c[refreshPeriod=<null>,groups=<null>,cronExpression=<null>]
    2006-02-10 12:58:43,818 DEBUG [com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache] - get called (key=629|22072380)
    2006-02-10 12:58:43,818 DEBUG [com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache] - persistRetrieve called (key=629|22072380)
    2006-02-10 12:58:43,818 DEBUG [com.opensymphony.oscache.base.Cache] - No cache entry exists for key='629|22072380', creating
    2006-02-10 12:58:43,819 DEBUG [org.springmodules.cache.provider.oscache.OsCacheFacade] - Method 'getFromCache(..)'. Object not found in the OSCache cache
    2006-02-10 12:58:43,819 DEBUG [org.springmodules.cache.provider.AbstractCacheProviderFacadeImpl] - Method 'getFromCache(CacheKey, String)'. Variable 'cachedObject': null
    Later, a call to "actualitzarFase" generates the following log (so the cache seems to be cleared):

    Code:
    2006-02-10 12:58:50,031 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - Initializing transaction synchronization
    2006-02-10 12:58:50,031 DEBUG [org.springmodules.cache.provider.AbstractCacheProviderFacadeImpl] - Method 'flushCache(String[])'. Argument 'cacheProfileIds': {cacheWheels}
    2006-02-10 12:58:50,031 DEBUG [org.springmodules.cache.provider.AbstractCacheProviderFacadeImpl] - Method 'getCacheProfile(String)'. Argument 'cacheProfileId': cacheWheels
    2006-02-10 12:58:50,031 DEBUG [org.springmodules.cache.provider.AbstractCacheProviderFacadeImpl] - Method 'getCacheProfile(String)'. Variable 'cacheProfile': org.springmodules.cache.provider.oscache.OsCacheProfile@190b03c[refreshPeriod=<null>,groups=<null>,cronExpression=<null>]
    2006-02-10 12:58:50,031 DEBUG [org.springmodules.cache.provider.AbstractCacheProviderFacadeImpl] - Method 'flushCache(String[])'. Cache flushed.
    2006-02-10 12:58:50,032 INFO [project.Dao.BaseDao] - Actualitzant la fase Calidad! per empresa 1
    2006-02-10 12:58:50,032 DEBUG [org.springframework.jdbc.core.JdbcTemplate] - Executing SQL update [ update hmFaseProduccion set hFaseProduccion=?, hOrdenEnProceso=?  where  CodigoEmpresa=? and hCodigoFaseProduccion=?]
    But a later call to "obtenirFasesProduccio" gets again the first cached value from the cache:

    Code:
    2006-02-10 12:58:50,125 DEBUG [org.springframework.transaction.support.TransactionSynchronizationManager] - Initializing transaction synchronization
    2006-02-10 12:58:50,125 DEBUG [org.springmodules.cache.provider.AbstractCacheProviderFacadeImpl] - Method 'getFromCache(CacheKey, String)'. Argument 'cacheKey': 629|22072380
    2006-02-10 12:58:50,125 DEBUG [org.springmodules.cache.provider.AbstractCacheProviderFacadeImpl] - Method 'getCacheProfile(String)'. Argument 'cacheProfileId': cacheWheels
    2006-02-10 12:58:50,125 DEBUG [org.springmodules.cache.provider.AbstractCacheProviderFacadeImpl] - Method 'getCacheProfile(String)'. Variable 'cacheProfile': org.springmodules.cache.provider.oscache.OsCacheProfile@190b03c[refreshPeriod=<null>,groups=<null>,cronExpression=<null>]
    2006-02-10 12:58:50,126 DEBUG [com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache] - get called (key=629|22072380)
    2006-02-10 12:58:50,126 DEBUG [org.springmodules.cache.provider.AbstractCacheProviderFacadeImpl] - Method 'getFromCache(CacheKey, String)'. Variable 'cachedObject': [project.Beans.Fase@1b5c3de, project.Beans.Fase@4e6138, project.Beans.Fase@1d0c37d, project.Beans.Fase@d2499a, project.Beans.Fase@1de3994, project.Beans.Fase@9637fe]
    2006-02-10 12:58:50,126 DEBUG [org.springframework.transaction.interceptor.TransactionInterceptor] - Invoking commit for transaction on project.Logica.IMantenimentAppBl.obtenirFases
    Anyone is using OSCache with Spring ? Maybe I should try another cache impl ?

    Regards,
    Esteve

  • #2
    Hi all,

    Well, I simply changed from OSCache to JCS and everything is going well... I've lost the CronExpression feature though.

    Regards,
    Esteve

    Comment


    • #3
      Then there might be an issue with OSCache. Post your problem on spring modules mailing list just in case - Alex, the maintainer, can probably help you out.

      Comment

      Working...
      X