当前位置 : 主页 > 网络编程 > 其它编程 >

可以禁用hibernate一级缓存吗

来源:互联网 收集:自由互联 发布时间:2023-07-02
Canhibernatefirstlevelcachingbedisabled?Incaseitcantbedisabled,arethereanyworkaroun Can hibernate first level caching be disabled? Incase it can't be disabled, are there any work arounds? 可以禁用hibernate一级缓存吗?如果它无法禁
Canhibernatefirstlevelcachingbedisabled?Incaseitcantbedisabled,arethereanyworkaroun

Can hibernate first level caching be disabled? Incase it can't be disabled, are there any work arounds?

可以禁用hibernate一级缓存吗?如果它无法禁用,有任何解决方法吗?

1 个解决方案

#1

2

Hibernate first level cache is associated with the Session object. Hibernate first level cache is enabled by default and there is no way to disable it. However hibernate provides methods through which we can delete selected objects from the cache or clear the cache completely. Any object cached in a session will not be visible to other sessions and when the session is closed, all the cached objects will also be lost.

Hibernate第一级缓存与Session对象相关联。默认情况下启用Hibernate第一级缓存,无法禁用它。但是,hibernate提供了一些方法,通过这些方法我们可以从缓存中删除所选对象或完全清除缓存。在会话中缓存的任何对象对其他会话都不可见,并且当会话关闭时,所有缓存的对象也将丢失。

【本文转自:国外高防服务器 http://www.558idc.com/usa.html转载请说明出处】
上一篇:基于C#的接口基础教程之七
下一篇:没有了
网友评论