Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache KeyGenerator.extract() should allow to use the bean identity [SPR-7971] #12626

Closed
spring-projects-issues opened this issue Feb 17, 2011 · 1 comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Sylvain LAURENT opened SPR-7971 and commented

The new org.springframework.cache.KeyGenerator<K> interface introduced with 3.1M1 does not allow to generate a key that would take the identity of the bean into account.

Imagine that a method of a service is annotated with @Cacheable and I deploy 2 instances of the service each with its own configuration. There is no way I can provide a KeyGenerator implementation that generates 2 different keys for the same arguments passed to the 2 different instances of the service.

The signature of the extract method should be augmented with a String that is the id of the target Spring bean in its beanFactory.


Affects: 3.1 M1

Referenced from: commits 5c3ceb8

1 votes, 1 watchers

@spring-projects-issues
Copy link
Collaborator Author

Costin Leau commented

Fixed in trunk. target object is now available in the method signature.

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.1 M2 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant