Hi,
every method annotated with @CacheFlush does not flush the cache
I turned on debug for org.springmodules.cache and the flush is never called.
i am using ehcache
configuration is the following
ehcache.xml
the cached and annotated dao is the followingCode:<?xml version="1.0" encoding="UTF-8"?> <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd"> <defaultCache maxElementsInMemory="500" eternal="true" overflowToDisk="false" memoryStoreEvictionPolicy="LFU" /> <cache name="i18NTextCache" maxElementsInMemory="5000" eternal="true" overflowToDisk="false" memoryStoreEvictionPolicy="LFU" /> </ehcache>
first execution of loadAll (db hit)Code:... import org.springmodules.cache.annotations.CacheFlush; import org.springmodules.cache.annotations.Cacheable; ... @Cacheable(modelId = "i18NTextCacheModel") public List<I18NText> loadAll() { logger.debug("loadAll called"); ... } @CacheFlush(modelId = "i18NTextFlushModel") public Long save(I18NText entity) { logger.debug("save called"); ... } }
execution of save (cache not flushed)Code:DEBUG [EhCacheFacade] Attempt to retrieve a cache entry using key <4267358|4266664> and cache model <org.springmodules.cache.provider.ehcache.EhCacheCachingModel@b9f82b[cacheName='i18NTextCache']> DEBUG [EhCacheFacade] Retrieved cache element <null> DEBUG [I18NTextDaoImpl] loadAll called INFO [STDOUT] Hibernate: select ... DEBUG [EhCacheFacade] Attempt to store the object...
and loadAll again (db not hit, cache used)Code:DEBUG [I18NTextDaoImpl] save called INFO [STDOUT] Hibernate: update ... INFO [STDOUT] Hibernate: insert ...
Code:DEBUG [EhCacheFacade] Attempt to retrieve a cache entry using key <4267358|4266664> and cache model <org.springmodules.cache.provider.ehcache.EhCacheCachingModel@b9f82b[cacheName='i18NTextCache']> DEBUG [EhCacheFacade] Retrieved cache element ...
any idea ?
thanks



