在springboot2.0中使用ehcache时,'sync = true'是否有效

时间:2018-06-14 06:04:27

标签: spring-boot ehcache

我在使用@cacheable的{​​{1}}中使用springboot2.0,但我不确定是否支持EHcache

如何检查?

1 个答案:

答案 0 :(得分:0)

@Cacheable允许您将sync属性指定为确保只有一个线程正在构建缓存值

如何查看:

通过发送两个并行请求来访问缓存数据并修改数据。第二个线程应该只获得更新的值。