栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

如何完全禁用Hibernate缓存?(对于Spring 3,带有注释的Hibernate)

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

如何完全禁用Hibernate缓存?(对于Spring 3,带有注释的Hibernate)

您是指一级缓存还是二级缓存?使用诸如Ehcache之类的Hibernate二级缓存来缓存与您手动修改的同一表中的行相对应的实体,可能会导致您描述的行为。一级缓存不会导致此行为,而且我认为您也不能禁用它。

要禁用Hibernate二级缓存,请从Hibernate配置文件中删除

hibernate-cfg.xml
所有引用二级缓存的行。例如:

<!-- Enable the second-level cache  --><property name="hibernate.cache.provider_class">    net.sf.ehcache.hibernate.EhCacheProvider</property><property name="hibernate.cache.region.factory_class">    net.sf.ehcache.hibernate.EhCacheRegionFactory</property><property name="hibernate.cache.use_query_cache">true</property><property name="hibernate.cache.use_second_level_cache">true</property><property name="hibernate.cache.use_structured_entries">true</property>     <property name="hibernate.cache.generate_statistics">true</property>


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/383833.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号