elunez / eladmin

eladmin jpa 版本:项目基于 Spring Boot 2.6.4、 Jpa、 Spring Security、Redis、Vue的前后端分离的后台管理系统,项目采用分模块开发方式, 权限控制采用 RBAC,支持数据字典与数据权限管理,支持一键生成前后端代码,支持动态路由
https://eladmin.vip/demo
Apache License 2.0
21.07k stars 7.33k forks source link

缓存一致性问题 #790

Closed wngjian closed 1 year ago

wngjian commented 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("出错了"); }

当对用户进行修改提交事务时,其他线程查询缓存会导致缓存中的数据还是更新前的记录。 image

image