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 problem [DATAREDIS-797] #1370

Closed
spring-projects-issues opened this issue Mar 27, 2018 · 1 comment
Closed

Cache problem [DATAREDIS-797] #1370

spring-projects-issues opened this issue Mar 27, 2018 · 1 comment
Assignees
Labels
in: cache RedisCache and CacheManager in: core Issues in core support in: jedis Jedis driver type: bug A general bug

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Mar 27, 2018

Sylvain opened DATAREDIS-797 and commented

Hi

That's my first use of jira. Hope to not disturb...

I Have got a problem when i try to use @Cacheable data redis

I try some tuto with the simple Person.class

PersonRepository extends JpaRepository<Person, String>

@Cacheable(value = "persons", keyGenerator = "customKeyGenerator")
	@GetMapping(value = "/persons")
	public List<Person> findAll() {
		LOGGER.info("*** FINDALL");
		return repo.findAll();
	}
 

It's working : when i shoot the url 2 times, this log is displaying only once! Perfect!


Now i try the same with a Feature class (geoJson context)

   @Cacheable(value = "features", keyGenerator = "customKeyGenerator")
@GetMapping("/features/findAll")
FeatureCollection findAllFeature(@RequestParam("key") String key) {
     LOGGER.info("COUCOU");
     return repo.findAll(key);
}

I insert in Redis with : { hashOps.put(key, f.getId(), f);}}

When i shoot the URL2 times, the log display twice... bad luck

P.S : i put some log in my KeyGenerator, and those logs are only displaying for Person tests...
Don t know why ...

Can you help to find out what am i doing wrong ?

Thanks


Affects: 1.8.10 (Ingalls SR10)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Feb 13, 2020

Mark Paluch commented

Using @Cacheable on controller methods can come with unexpected side-effects. Closing this ticket as we cannot reproduce it and it's outdated

@spring-projects-issues spring-projects-issues added in: cache RedisCache and CacheManager type: bug A general bug in: jedis Jedis driver in: core Issues in core support labels Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: cache RedisCache and CacheManager in: core Issues in core support in: jedis Jedis driver type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants