认识ehcache的配置文件: ehcache.xml
来源:互联网 发布:服装成本核算软件 编辑:程序博客网 时间:2024/04/29 15:42
<ehcache> <!-- 指定一个目录:当 EHCache 把数据写到硬盘上时, 将把数据写到这个目录下. --> <diskStore path="d:\\tempDirectory"/> <!-- 设置缓存的默认数据过期策略 --> <defaultCache maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" /> <!-- 设定具体的命名缓存的数据过期策略。每个命名缓存代表一个缓存区域 缓存区域(region):一个具有名称的缓存块,可以给每一个缓存块设置不同的缓存策略。 如果没有设置任何的缓存区域,则所有被缓存的对象,都将使用默认的缓存策略。即:<defaultCache.../> Hibernate 在不同的缓存区域保存不同的类/集合。 对于类而言,区域的名称是类名。如:com.atguigu.domain.Customer 对于集合而言,区域的名称是类名加属性名。如com.atguigu.domain.Customer.orders --> <!-- name: 设置缓存的名字,它的取值为类的全限定名或类的集合的名字 maxElementsInMemory: 设置基于内存的缓存中可存放的对象最大数目 eternal: 设置对象是否为永久的, true表示永不过期, 此时将忽略timeToIdleSeconds 和 timeToLiveSeconds属性; 默认值是false timeToIdleSeconds:设置对象空闲最长时间,以秒为单位, 超过这个时间,对象过期。当对象过期时,EHCache会把它从缓存中清除。如果此值为0,表示对象可以无限期地 处于空闲状态。 timeToLiveSeconds:设置对象生存最长时间,超过这个时间,对象过期。如果此值为0,表示对象可以无限期地存在于缓存中. 该属性值必须大于或等于 timeToIdleSeconds 属性值 overflowToDisk:设置基于内存的缓存中的对象数目达到上限后,是否把溢出的对象写到基于硬盘的缓存中 --> <cache name="com.atguigu.hibernate.entities.Employee" maxElementsInMemory="1" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600" overflowToDisk="true" /> <cache name="com.atguigu.hibernate.entities.Department.emps" maxElementsInMemory="1000" eternal="true" timeToIdleSeconds="0" timeToLiveSeconds="0" overflowToDisk="false" /></ehcache>
0 0
- 认识ehcache的配置文件: ehcache.xml
- ehcache.xml及结合shiro缓存的ehcache的配置文件
- ehcache.xml配置文件说明
- ehcache.xml配置文件详解
- ehcache.xml配置文件详解
- ehcache.xml配置文件详解
- ehcache的配置文件
- ehcache的配置文件
- Ehcache缓存的配置文件
- ehcache的xml配置
- Ehcache -- ehcache.xml
- spring ehcache 多个maven module 中多个ehcache.xml 配置文件的处理方式
- EhCache配置文件
- Ehcache配置文件
- EhCache配置文件
- 自己动手写ehcache工具类和配置文件ehcache.xml
- 配置文件ehcache.xml详解(3)—<ehcache>
- mybatis的缓存配置--ehcache.xml(缓存配置文件)
- JSP小结-请求转发与内建对象
- Matlab与线性代数 -- 矩阵的加法与减法
- 自绘控件的4种方法
- sae使用web.py出现错误:internal server error
- Linux下创建任意大小的测试文件
- 认识ehcache的配置文件: ehcache.xml
- 2016.10.28小鹿Facebook翻译
- OCR文本识别系统项目文档——欢迎探讨交流
- bind方法绑定多个jquery事件
- javascript字符串相关api(一)
- 【Phpadmin】解决phpadmin的“It is not safe to rely on the system’s timezone settings”问题
- 206. Reverse Linked List
- 十月英语总结—执行力
- 小码哥杯java程序比赛复习(十)常用类(中)