当前位置: 首页 > news >正文

ehcache.xml详解

<?xml version="1.0" encoding="UTF-8"?>
<ehcache>
    <!-- Sets the path to the directory where cache .data files are created.
    设置缓存文件被创建的目录路径
     If the path is a Java System Property it is replaced by
     its value in the running VM.
如果这个路径是Java System Property,那么这个路径就会被这个属性值所替代
     The following properties are translated:
     user.home - User's home directory
     user.dir - User's current working directory
     java.io.tmpdir - Default temp file path -->

    <!--Default Cache configuration. These will applied to caches programmatically created through
        the CacheManager.

        The following attributes are required:

        maxElementsInMemory            - Sets the maximum number of objects that will be created in memory
                                        设置内存中创建的最大对象个数
        eternal                                     - Sets whether elements are eternal. If eternal,  timeouts are ignored and the element is never expired.
                                                    设置元素是否永恒,如果永恒,那么将忽略超时限制并且该元素永远不会过期
        overflowToDisk                      - Sets whether elements can overflow to disk when the in-memory cache has reached the maxInMemory limit.
                                            设置在内存中的缓存达到打到最大的对象数时是否允许溢出到磁盘

        The following attributes are optional:
        timeToIdleSeconds            -     Sets the time to idle for an element before it expires.    
                                        设置元素过期之前的空闲时间                                    
                                                        i.e. The maximum amount of time between accesses before an
                                                        element expires Is only used if the element is not eternal.
                                                        Optional attribute. A value of 0 means that an Element can idle
                                                        for infinity.The default value is 0.
        timeToLiveSeconds              - Sets the time to live for an element before it expires.
                                        设置元素过期之前的时间
                                                         i.e. The maximum time between creation time and when an element
                                                         expires.  Is only used if the element is not eternal.
                                                         Optional attribute. A value of 0 means that and Element can live
                                                         for infinity.
                                                        The default value is 0.
        diskPersistent                           - Whether the disk store persists between restarts of the Virtual Machine.
                                                    在重启虚拟机后磁盘存储是否还存在
                                                         The default value is false.
        diskExpiryThreadIntervalSeconds   - The number of seconds between runs of the disk expiry thread.
                                            磁盘失效线程之间的运行秒数。
                                                         The default value  is 120 seconds.
        --> <diskStore path="/data/ehcache"/> <defaultCache maxElementsInMemory="10000" eternal="false" overflowToDisk="true" timeToIdleSeconds="120" timeToLiveSeconds="180" diskPersistent="false" diskExpiryThreadIntervalSeconds="60" /> <cache name="org.hibernate.cache.StandardQueryCache" maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="4200" overflowToDisk="true" /> <cache name="org.hibernate.cache.UpdateTimestampsCache" maxElementsInMemory="5000" eternal="true" timeToIdleSeconds="0" timeToLiveSeconds="0" overflowToDisk="false" /> </ehcache>

 

转载于:https://www.cnblogs.com/liaojie970/p/4844395.html

相关文章:

  • 【Struts2学习笔记(9)】单文件上传和多文件上传
  • 如何更改Java默认的花括号对齐方式
  • GET和POST区别和用法
  • 【Struts2学习笔记(10)】自定义拦截器管理权限访问
  • 大型网站提速方案
  • 【Struts2学习笔记(11)】对action的输入校验和XML配置方式实现对action的所有方法进行输入校验
  • 分享一百多套开发视频教程的下载地址
  • java中Object类 源代码详解
  • 史上最全Java学习视频下载地址分享
  • MySql 查询一周内最近7天记录
  • 【Struts2学习笔记(12)】Struts2国际化
  • 【Struts2学习笔记(13)】Struts2中OGNL详解
  • 【Struts2学习笔记(14)】Struts2标签元素
  • SSH2框架搭建Jar下载地址
  • hibernate.cfg.xml文件的配置模板和不同数据库的配置参数
  • 自己简单写的 事件订阅机制
  • [译] 理解数组在 PHP 内部的实现(给PHP开发者的PHP源码-第四部分)
  • css的样式优先级
  • Spark学习笔记之相关记录
  • 多线程事务回滚
  • 聊聊redis的数据结构的应用
  • 盘点那些不知名却常用的 Git 操作
  • 前端自动化解决方案
  • 首页查询功能的一次实现过程
  • 用element的upload组件实现多图片上传和压缩
  • 责任链模式的两种实现
  • nb
  • #DBA杂记1
  • #define 用法
  • (ibm)Java 语言的 XPath API
  • (翻译)terry crowley: 写给程序员
  • (十八)三元表达式和列表解析
  • (中等) HDU 4370 0 or 1,建模+Dijkstra。
  • (转)JVM内存分配 -Xms128m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=512m
  • (转)Linux整合apache和tomcat构建Web服务器
  • (转载)微软数据挖掘算法:Microsoft 时序算法(5)
  • . ./ bash dash source 这五种执行shell脚本方式 区别
  • .dwp和.webpart的区别
  • .Net Core 中间件验签
  • .NET Micro Framework 4.2 beta 源码探析
  • .NET大文件上传知识整理
  • .NET的数据绑定
  • .NET面试题解析(11)-SQL语言基础及数据库基本原理
  • .secret勒索病毒数据恢复|金蝶、用友、管家婆、OA、速达、ERP等软件数据库恢复
  • @javax.ws.rs Webservice注解
  • @requestBody写与不写的情况
  • [ vulhub漏洞复现篇 ] GhostScript 沙箱绕过(任意命令执行)漏洞CVE-2019-6116
  • [20161101]rman备份与数据文件变化7.txt
  • [ACM] hdu 1201 18岁生日
  • [BUG] Hadoop-3.3.4集群yarn管理页面子队列不显示任务
  • [C++ 从入门到精通] 12.重载运算符、赋值运算符重载、析构函数
  • [C++]四种方式求解最大子序列求和问题
  • [CISCN2019 华北赛区 Day1 Web2]ikun
  • [CTO札记]盛大文学公司名称对联
  • [ffmpeg] x264 配置参数解析