Closed wngjian closed 1 year ago
版本: master 环境:本地 复现步骤: @Transactional(rollbackFor = Exception.class) public void testCache2(String name) { System.out.println("开始处理事务缓存>>>>"); redisUtils.set(CacheKey.DICT_NAME + name, "测试缓存值"); System.out.println("处理事务缓存结束>>>>"); throw new RuntimeException("出错了"); }
当对用户进行修改提交事务时,其他线程查询缓存会导致缓存中的数据还是更新前的记录。
版本: master 环境:本地 复现步骤: @Transactional(rollbackFor = Exception.class) public void testCache2(String name) { System.out.println("开始处理事务缓存>>>>"); redisUtils.set(CacheKey.DICT_NAME + name, "测试缓存值"); System.out.println("处理事务缓存结束>>>>"); throw new RuntimeException("出错了"); }
当对用户进行修改提交事务时,其他线程查询缓存会导致缓存中的数据还是更新前的记录。![image](https://user-images.githubusercontent.com/16042161/221740810-366954e6-ac44-4f6d-81fc-cd411ae99066.png)