【问题标题】:What can hibernate's hibernate.cache.use_structured_entries do?hibernate 的 hibernate.cache.use_structured_entries 能做什么?
【发布时间】:2012-08-31 00:47:08
【问题描述】:
<property name="hibernate.cache.use_structured_entries">true</property>

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

【问题讨论】:

标签: java hibernate caching


【解决方案1】:

来自Hibernate Docs - Chapter 3. Configuration

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

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

来自Hibernate Docs - Chapter 19. Improving performance

要浏览二级缓存区域的内容或查询缓存区域,请使用 Statistics API: 您需要启用统计信息,并且可以选择强制 Hibernate 保留缓存条目以更易读的格式:
hibernate.generate_statistics = true
hibernate.cache.use_structured_entries = true

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

您可能会发现以下博客文章对这个问题特别有帮助:Hibernate Wars: The Query Cache Strikes Back,尤其是奖励:L2 缓存减少部分。

【讨论】:

  • 好的,我会看到帖子的。谢谢!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-11-20
  • 2011-08-23
  • 2017-09-02
  • 2018-05-30
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多