Closed 1995mars closed 2 months ago
Thank you for reaching out - Please take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem.
Thank you for reaching out - Please take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem.
I have provided the code, please check it for me
Each @Cacheable
annotation defines a scheme to access the cache along with its cache keys. @CachePut(value = "product")
doesn't define a scheme for a cache key so invocations use Product product
as the cache key.
This is a Spring Framework topic and Stackoverflow is much better to discuss these questions.
``I'm trying to integrate Spring cache within my project. I've set up a Redis cache manager and it indeed works. However, this is my scenario: I have a Product entity. I want to make a findAll method that can return all of the products .
When I call to getAllProducts I get a product::SimpleKey [] key in my Redis (that's my expected behaviour). However, when I call to updateProduct, because of the extra argument, instead of overrding the product::SimpleKey [] key, I end up with another key in Redis: "product::SimpleKey []"
How do I synchronize data to cache when I update or add new data? So that when I call the getAllProducts method, I can get the data after the change in cache.
I'll appriciate any help!