scwanglijun / ehcache-spring-annotations

Automatically exported from code.google.com/p/ehcache-spring-annotations
0 stars 1 forks source link

Remove Cache with Two Parameters does not work #71

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
After calling deleteCageHighlightCache(x,y), getCageHighlight(x,y) still return 
data from cache. Puzzled... 

What steps will reproduce the problem?
1.

What is the expected output? What do you see instead?
Cache removed

What version of the product are you using? On what operating system?
1.1.3

Please provide any additional information below.
    @TriggersRemove(cacheName="RackManager.getCageHighlight",
            keyGenerator = @KeyGenerator (
                    name = "HashCodeCacheKeyGenerator",
                    properties = @Property( name="includeMethod", value="false" )
                )
            )
    public Map<String, Integer> deleteCageHighlightCache( String category,  String rackUuid) {
        logger.info("REMOVING CACHE : RackManager.getCageHighlight( " + category + ", " + rackUuid + " )" );
        return null;
    }

    @Cacheable(cacheName="RackManager.getCageHighlight",
            keyGenerator = @KeyGenerator (
                    name = "HashCodeCacheKeyGenerator",
                    properties = @Property( name="includeMethod", value="false" )
                )
            )
    public Map<String, Integer> getCageHighlight( String category, String rackUuid) {
        ...
        ...
    }

Original issue reported on code.google.com by devilkaz...@gmail.com on 20 Apr 2011 at 8:39

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Can you turn up logging to debug for the com.googlecode.ehcache.annotations 
package and see if the same cache keys are being generated for both method 
invocations?

Original comment by eric.dalquist on 20 Apr 2011 at 12:16

GoogleCodeExporter commented 9 years ago
Yes. It generates different keys and it happened to be that I pass in different 
parameter values. My mistake. 
Changed my code, tested again, and it's working fine.

Sorry for false alert.
Thanks for great response.

Original comment by devilkaz...@gmail.com on 21 Apr 2011 at 3:06

GoogleCodeExporter commented 9 years ago
No problem, glad it was an easy fix :)

Original comment by eric.dalquist on 21 Apr 2011 at 3:15