copyOnRead和copyOnWrite不适用于Hibernate缓存L2

时间:2019-03-15 20:11:14

标签: java spring hibernate caching ehcache

我遵循了本教程,将 Hibernate V5.XXX缓存L2 Spring V5.XXX 结合使用: https://www.baeldung.com/hibernate-second-level-cache

我为我的缓存实体将 缓存策略的属性配置为Transactional 。 我仅使用默认缓存配置ehcache.xml,在默认缓存中,我将属性 copyOnRead copyOnWrite 设置为 TRUE

我的问题是在缓存中进行了缓存实体的本地更改。例如,在回滚的情况下,缓存将返回先前的本地更改。是什么让我相信我的copyOnRead和copyOnWrite行为配置与Hibernate cache L2配置不兼容。我可以做错什么吗?

请帮助

0 个答案:

没有答案