user871611
user871611

Reputation: 3461

Spring @Cachable: Not working on methods with parameters

I wanted to try the Spring 3.1 Cache Abstraction, annotating some methods with @Cachable. This is working just fine on methods without parameters. For methods with parameters it doesn't. Couldn't find anything in the docs (http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/cache.html).

Anybody experiencing the same thing?

The method call is :

@Cachable("countries") 
public List<ConfigEntity> findCountries(Locale locale) { 
    ConfigSearchDescription desc = new ConfigSearchDescription(); 
    // ... 
    return findConfigs(desc); 
} 

Thanks Jonny

Upvotes: 0

Views: 1464

Answers (1)

user871611
user871611

Reputation: 3461

Are you calling this method from another method of the same bean? Remember that in this case proxies usually can't intercept these calls.

This was my mistake.

Thanks all for your help

Upvotes: 6

Related Questions