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
@CacheFlush does not flush Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @CacheFlush does not flush

    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
    Code:
    <?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>
    the cached and annotated dao is the following
    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");
    		...
    	}
    }
    first execution of loadAll (db hit)
    Code:
    DEBUG [EhCacheFacade] Attempt to retrieve a cache entry using key <4267358|4266664> and cache model <[email protected]2b[cacheName='i18NTextCache']>
    DEBUG [EhCacheFacade] Retrieved cache element <null>
    DEBUG [I18NTextDaoImpl] loadAll called
    INFO  [STDOUT] Hibernate: select ...
    DEBUG [EhCacheFacade] Attempt to store the object...
    execution of save (cache not flushed)
    Code:
    DEBUG [I18NTextDaoImpl] save called
    INFO  [STDOUT] Hibernate: update ...
    INFO  [STDOUT] Hibernate: insert ...
    and loadAll again (db not hit, cache used)
    Code:
    DEBUG [EhCacheFacade] Attempt to retrieve a cache entry using key <4267358|4266664> and cache model <[email protected]2b[cacheName='i18NTextCache']>
    DEBUG [EhCacheFacade] Retrieved cache element ...

    any idea ?

    thanks
    Last edited by paolo_denti; Aug 21st, 2007, 01:59 PM.

  • #2
    same problem even with the tonight snapshot of 0.9 version

    Comment


    • #3
      no idea from anybody ?

      Comment


      • #4
        @CacheFlush Still failing

        Hello

        Was this issue ever resolved? Every method I annotate with @CacheFlush doesn't ever flush the cache. @Cacheable works fine.

        Thanks

        Mark

        Comment


        • #5
          Originally posted by markandirene View Post
          Hello

          Was this issue ever resolved? Every method I annotate with @CacheFlush doesn't ever flush the cache. @Cacheable works fine.

          Thanks

          Mark
          i don't think so ... i simply avoided to use the cache modules.
          anyway, no answer for such a big "what looks a bug" looks very strange.

          Comment


          • #6
            Can you post your spring configuration..

            Can the spring cache configuration be posted? (Also, you might want to annotate the interface class, not the actual implementation class, sometimes that fixes it).

            Also, within Spring-Modules search for RShelley post with the title "Declarative Caching" (I can't post links yet). It has a lot of useful information on setting up.
            Last edited by joshr; Oct 8th, 2008, 03:42 PM.

            Comment

            Working...
            X