【发布时间】:2021-08-31 17:29:22
【问题描述】:
一个简单的Spring Boot 2.5 application,带有 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 配置是什么?
【问题讨论】:
标签: java spring hibernate caching ehcache