java - HHH90001006:缺少缓存 [default-update-timestamps-region] 是即时创建的
问题描述
一个简单的Spring Boot 2.5 应用程序,带有带有 EhCache 3 的 Spring Data JPA 和启用了查询和二级缓存的 Hibernate 5:
spring.jpa.properties.hibernate.cache.use_query_cache=true
spring.jpa.properties.hibernate.cache.use_second_level_cache=true
在启动时为每个缓存生成来自 Hibernate 的警告和来自 EhCache 的信息消息:
WARN org.hibernate.orm.cache HHH90001006: Missing cache[default-update-timestamps-region] was created on-the-fly. The created cache will use a provider-specific default configuration: make sure you defined one. You can disable this warning by setting 'hibernate.javax.cache.missing_cache_strategy' to 'create'.
INFO org.ehcache.core.EhcacheManager Cache 'default-update-timestamps-region' created in EhcacheManager.
和
WARN org.hibernate.orm.cache HHH90001006: Missing cache[default-query-results-region] was created on-the-fly. The created cache will use a provider-specific default configuration: make sure you defined one. You can disable this warning by setting 'hibernate.javax.cache.missing_cache_strategy' to 'create'.
INFO org.ehcache.core.EhcacheManager Cache 'default-query-results-region' created in EhcacheManager.
这些 Hibernate 缓存的正确 EhCache 配置是什么?
解决方案
这是一个很好的解释:https ://www.ehcache.org/documentation/2.8/integrations/hibernate.html#configure-
如果您希望这些警告消失,您可以在 ehcache.xml 中明确定义缓存,或者使用create
配置值作为警告日志。
推荐阅读
- pdf - 从 PDF 文件复制时印地语内容失真
- amazon-web-services - ECS 集群中没有实例
- sql - 在同一查询中使用查询结果字段作为数据库名称
- tensorflow - Tensorflow dense_image_warp 无法转换类型的对象
张量 - django - 将数据添加到数据库后更新 Django 表单
- auth0 - Auth0 PasswordLess - 在锁定 11 中为用户提供电子邮件和短信验证选项
- .htaccess - Redirect all pages ( from a server to another's homepage) except one
- active-directory - Active Directory 中“人员”和“用户”OU 之间的区别
- node.js - How to use Ziggy package in Typescript
- django - Python django 添加多个数据库