【发布时间】:2016-04-26 09:32:06
【问题描述】:
我正在尝试在单个方法上调用 @CacheEvict 和 @Cacheable 注释。
@CacheEvict(value = "tripDetailsDashboardCache", key = "#userId")
@Cacheable(value ="tripDetailsDashboardCache", key="#userId")
public List<DashBoardObject> getAllDetailsForDashBoard(Integer userId){
List<Master> masters = tripDetailsService.getTripDetailsForCaching(userId);
List<DashBoardObject> dashBoardObject = tripDetailsService.getMasterDetailsForDashBoard(userId, masters);
return dashBoardObject;
}
在调用@CacheEvict 时,我想删除特定键的缓存数据,并再次缓存方法响应的新数据。但它没有缓存新数据?而且它没有给出任何错误?。
【问题讨论】:
标签: spring-cache spring-data-redis