hibernate - 获取 region_prefix 以使用 redisson-hibernate-53 L2 缓存
问题描述
我正在尝试使用 Redisson(Spring 2.3.0、Hibernate 5.4.15、redisson-hibernate-53)将 Redis 配置为 Spring Boot 应用程序的 Hibernate 的 L2 缓存。
应用程序 YAML 在 spring.jpa.properties.hibernate 下有这个部分
cache:
use_second_level_cache: true
region.factory_class: org.redisson.hibernate.RedissonRegionFactory
region_prefix: app1
redisson:
config: redisson.yaml
fallback: true
除 region_prefix 外,一切正常。在 redis-cli 中运行的响应KEYS *
显示主键是我的 Cacheable 实体的完全限定类名,但它没有区域前缀。RedissonRegionFactory
我在Hibernate 的相关代码和相关代码中看不到任何引用RegionNameQualifier
。
有没有人有这个工作或者它是一个错误?
解决方案
你不能让它工作。我打开了一个问题,他们立即修复了它。它将与Redisson 3.13.7
. Redission 忽略了缓存区域前缀。
见问题
推荐阅读
- javascript - 在Angular 7中覆盖日期对象
- python-3.x - 遍历 pandas 中的一列并从下一列返回匹配值
- javascript - 无法在 reactjs 项目中安装 material-ui/core?
- c++ - g++: /usr/bin/ld: 找不到 -lmax7219 链接错误
- c++ - 使用 freetype 渲染字体
- python - 使用硬编码的全局变量模拟装饰器
- javascript - Apollo 服务器:在上下文中抛出错误总是在客户端返回 http 400 错误
- jenkins - 何通过 Jenkins 在 Sauce Labs 上运行多个移动测试?
- amazon-web-services - 向负载均衡器后面的所有实例发送消息
- c# - 从用法中自动推断类型