hibernate中的二级缓存是什么?

发布于 2024-09-01 09:08:00 字数 26 浏览 2 评论 0原文

hibernate中的二级缓存是什么?

What is second level cache in hibernate ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

顾北清歌寒 2024-09-08 09:08:00

Hibernate 具有三种不同的缓存:一级缓存、二级缓存和查询缓存。

第一级缓存是Hibernate Session,用于跟踪当前Session(或工作单元)期间实体的状态。这是事务级缓存。

二级缓存在各个会话之间共享实体状态。这是一个 SessionFactory 级别的缓存。

查询缓存用于缓存查询(及其参数)及其结果。

推荐阅读

Hibernate comes with three different caches: first level, second level and query cache.

The first level cache is the Hibernate Session and is used to track the state of entities during the current Session (or unit of work). This is a transaction-level cache.

The second level cache shares entity state across various Session. This is a SessionFactory-level cache.

The query cache is used to cache queries (and their parameters) and their results.

Recommended readings

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文