什么是休眠中的二级缓存? [英] What is second level cache in hibernate?

查看:97
本文介绍了什么是休眠中的二级缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hibernate中的第二级缓存是什么?Hibernate有三种不同的缓存:第一级,第二级和查询缓存。

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



二级缓存跨多个Session共享实体状态。这是一个SessionFactory级别的缓存。



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

>

推荐阅读




What is second level cache in hibernate ?

解决方案

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

这篇关于什么是休眠中的二级缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆