-1

Spring Cache abstraction doesn't support blocking cache, meaning a cache that when you do a read operation for the same key at the same time on multiple threads, the cacheable method would be invoked only once. Guava cache supports that feature out of the box with LoadingCache. Does Spring plan to introduce a separate blocking cache abstraction layer that would work with guava cache? In some cases it's essential that the cacheable method is invoked only once for a key so i think it'd be a nice feature to have.

mike27
  • 965
  • 3
  • 12
  • 22
  • 1
    Stackoverflow is not spring support site. Doing a feature request for 3rd party software don't belongs to here – J-16 SDiZ Sep 04 '15 at 11:42
  • possible duplicate of [Concurrent calls to cached method](http://stackoverflow.com/questions/32340954/concurrent-calls-to-cached-method) – Stephane Nicoll Sep 14 '15 at 15:55

1 Answers1

1

Check SPR-9254.

While I agree that it looks like a good feature, this definitely involves locking and overhead to make it work properly. Of course, you don't have to worry about that low-level stuff since it is handled at the library level. But that doesn't mean nothing potentially nasty is happening behind the scenes.

Anyway, that issue should give you enough context of where we stands.

(By the way, no need to create several SO thread for the same issue).

Stephane Nicoll
  • 31,977
  • 9
  • 97
  • 89