hibernate二级缓存
来源:互联网 发布:js数组join方法 编辑:程序博客网 时间:2024/06/01 12:17
第一步spring-hibernate.xml文件增加属性
<propertyname="hibernateProperties">
<props>
<propkey="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
</props>
</property>
第二部 src目录下创建 缓存文件 ehcache.xml
<?xmlversion="1.0"encoding="UTF-8"?>
<ehcachexmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">
<diskStorepath="java.io.tmpdir/EhCacheSpringAnnotationsExampleApp"/>
<defaultCacheeternal="false"maxElementsInMemory="1000"
overflowToDisk="false"diskPersistent="false"timeToIdleSeconds="0"
timeToLiveSeconds="600"memoryStoreEvictionPolicy="LRU"/>
</ehcache>
<!-- <cachename="org.hibernate.cache.StandardQueryCache"-->
<!-- maxElementsInMemory="10000"-->
<!-- eternal="false"-->
<!-- timeToIdleSeconds="300"-->
<!-- timeToLiveSeconds="4200"-->
<!-- overflowToDisk="true"-->
<!-- />-->
<!---->
<!-- Sample cache named sampleCache2-->
<!-- This cache contains 1000 elements.Elements will always be held in memory.-->
<!-- They are not expired. -->
<!---->
<!-- <cachename="org.hibernate.cache.UpdateTimestampsCache"-->
<!-- maxElementsInMemory="5000"-->
<!-- eternal="true"-->
<!-- timeToIdleSeconds="0"-->
<!-- timeToLiveSeconds="0"-->
<!-- overflowToDisk="false"-->
<!-- /> -->
<!---->
<!-- <cachename="com.csst.club.domain.code.TCodeCertiType"-->
<!-- maxElementsInMemory="5000"-->
<!-- eternal="true"-->
<!-- timeToIdleSeconds="120"-->
<!-- timeToLiveSeconds="120"-->
<!-- overflowToDisk="false"-->
<!-- /> -->
<!---->
第三部映射文件加入配置项 <cache></cache>
使用缓存查找集合
- hibernate 二级缓存
- hibernate 二级缓存
- hibernate二级缓存
- Hibernate二级缓存
- hibernate二级缓存
- hibernate 二级缓存
- Hibernate 二级缓存
- hibernate二级缓存
- Hibernate二级缓存
- hibernate二级缓存
- Hibernate二级缓存
- Hibernate 二级缓存
- hibernate二级缓存
- hibernate 二级缓存
- hibernate 二级缓存
- Hibernate二级缓存
- hibernate 二级缓存
- Hibernate二级缓存
- 给定数字的全部组合实现方式
- ubuntu下ruby文件执行蛋疼的一个问题
- rsync @ERROR: chdir failed rsync error: error starting client-server protocol (code 1503)
- 第三方分享按钮对比
- Booth除法器设计
- hibernate二级缓存
- 中缀表达式转换成后缀表达式
- 使用MVC Areas分离ASP.NET MVC项目
- archiving出错:Undefined symbols for architecture arm64
- 第十四周项目二(3)——带姓名的成绩单
- 第十四周项目 5 体会棋盘游戏中的数据存储
- java 调用 短信API服务 (聚合数据平台)
- iOS基础UI
- 理解linux下的DNS