java - 二级缓存中缓存了什么?

标签 java hibernate

来自 Hibernate 文档(重点是我的):

By default, entities are not part of the second level cache and we recommend you to stick to this setting. However, you can override this by setting the shared-cache-mode element in your persistence.xml file or by using the javax.persistence.sharedCache.mode property in your configuration.

二级缓存中缓存了什么?

最佳答案

你有一级缓存和二级缓存。 第一级缓存保留在事务上,这就是为什么您必须调用刷新才能在使用同一行的事务之间保持一致。 然而,二级缓存在事务之间共享。

缓存相同的对象,区别在于它们是否在 session 之间共享。

关于java - 二级缓存中缓存了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42113609/

相关文章:

java - 使用 Google OAuth2 API 对 Google App 用户进行身份验证

java - 如何在Java中进行.MOV到3GP的转换操作

java - hibernate-java8 依赖项无助于正确保存日期

mysql - 如何用mybatis做分页?

java - 有编辑程序流程的库吗?

java - 无法将 xml 转换为 java 对象

java - hibernate nativesqlquery批量插入

java - SingletonEhCacheRegionFactory 与 EhCacheRegionFactory

java - Hibernate 的轻量级替代品?

java - 额外速度引擎输出