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

Insert all elements of a returned list into a Cache [SPR-15213] #19777

Closed
spring-issuemaster opened this issue Jan 31, 2017 · 1 comment
Closed

Insert all elements of a returned list into a Cache [SPR-15213] #19777

spring-issuemaster opened this issue Jan 31, 2017 · 1 comment

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Jan 31, 2017

Wouter Lievens opened SPR-15213 and commented

When a query method returns a list, I would like to be able to insert each element of that list separately into a Cache, each with its own associated key.


Reference URL: http://stackoverflow.com/questions/41966690/putting-all-returned-elements-into-a-spring-boot-cache-using-annotations

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Feb 1, 2017

Stéphane Nicoll commented

Thanks for creating the issue but I am not keen to add this extra complexity to the cache abstraction. It is not meant to manage state for you (the next logical step if we allow this is that we have to keep the returned list in sync with each item). And if we don't we are inconsistent and we merely provide a way to talk to the cache using annotations. That's not very helpful.

Back to your example, this is typically what a second level cache is meant to do for you. This is not in the scope of the cache abstraction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.