【发布时间】:2012-08-31 00:47:08
【问题描述】:
<property name="hibernate.cache.use_structured_entries">true</property>
它能做什么?我不知道?请举个例子!
【问题讨论】:
-
您是否尝试过 google 的解决方案?例如它的文档:docs.jboss.org/hibernate/orm/3.3/reference/en/html/…
<property name="hibernate.cache.use_structured_entries">true</property>
它能做什么?我不知道?请举个例子!
【问题讨论】:
来自Hibernate Docs - Chapter 3. Configuration:
强制 Hibernate 以更人性化的格式将数据存储在二级缓存中。例如真|假
它指定条目是否以可读格式写入 L2 缓存中。如果您打算浏览缓存,您可能应该打开它。
来自Hibernate Docs - Chapter 19. Improving performance:
要浏览二级缓存区域的内容或查询缓存区域,请使用 Statistics API:
您需要启用统计信息,并且可以选择强制 Hibernate 保留缓存条目以更易读的格式:hibernate.generate_statistics = truehibernate.cache.use_structured_entries = true
将参数设置为true 将在L2 cache 中产生一些开销。看起来,它不能在集群环境中关闭,因为在这种情况下需要开销来重新水化实体。
您可能会发现以下博客文章对这个问题特别有帮助:Hibernate Wars: The Query Cache Strikes Back,尤其是奖励:L2 缓存减少部分。
【讨论】: