Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2206

Spring Data Redis Repository - save() exectues DEL operation which leads to race condition with findAll()

$
0
0

I began using Spring Data Redis, with the high level Repository abstraction.My application has many threads which read and update entities at the same time.

To my amazement, when updating an entity Spring calls DEL operation before re-saving the entity:https://github.com/spring-projects/spring-data-redis/issues/1135

This leads to a race condition in my app - the findAll() method is sometimes called between the DEL and HMSET operations, which results in missing values.

I wasn't able to find a way to use the Repository higher level api without having this critical issue.

I am trying to use the lower level RedisTemplate to implement it myself - Is there some guide on how to implement it, so that it will function like the provided Repository interface?

Thank you


Viewing all articles
Browse latest Browse all 2206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>