4
<property name="hibernate.cache.use_structured_entries">true</property>

它能做什么?我不知道?请举个例子!

4

1 回答 1

10

Hibernate Docs - 第 3 章。配置

强制 Hibernate 以更人性化的格式将数据存储在二级缓存中。例如真|假

它指定条目是否将以可读格式写入 L2 缓存中。如果您打算浏览缓存,您可能应该打开它。

来自Hibernate Docs - 第 19 章。提高性能

要浏览二级缓存区域的内容或查询缓存区域,请使用 Statistics API
hibernate.generate_statistics = true
hibernate.cache.use_structured_entries = true

将参数设置为将在L2 缓存true中产生一些开销。看起来,它不能在集群环境中关闭,因为在这种情况下需要开销来重新水化实体。

您可能会发现以下博客文章对这个问题特别有帮助:Hibernate Wars: The Query Cache Strikes Back,特别是Bonus:L2 Cache Reduction部分。

于 2012-09-06T08:39:10.657 回答