• hibernate配置二级缓存


    ehcache.xml:

    < ?xml version=”1.0″ encoding=”UTF-8″?>
    < !–
    defaultCache节点为缺省的缓存策略
    maxElementsInMemory 内存中最大允许存在的对象数量
    eternal 设置缓存中的对象是否永远不过期
    overflowToDisk 把溢出的对象存放到硬盘上
    timeToIdleSeconds 指定缓存对象空闲多长时间就过期,过期的对象会被清除掉
    timeToLiveSeconds 指定缓存对象总的存活时间
    diskPersistent 当jvm结束是是否持久化对象
    diskExpiryThreadIntervalSeconds 指定专门用于清除过期对象的监听线程的轮询时间
    –>
    < ehcache>
    < diskStore path=”D:cache”/>
    < defaultCache maxElementsInMemory=”1000″ eternal=”false” overflowToDisk=”true”
    timeToIdleSeconds=”120″
    timeToLiveSeconds=”180″
    diskPersistent=”false”
    diskExpiryThreadIntervalSeconds=”60″/>
    < cache name=”cn.itcast.bean.Person” maxElementsInMemory=”100″ eternal=”false”
    overflowToDisk=”true” timeToIdleSeconds=”300″ timeToLiveSeconds=”600″ diskPersistent=”false”/>
    < /ehcache>

    xxx.hbm.xml:

    < cache usage=”read-write” region=”xxx.xxx.xxx.xxx”/>

  • 相关阅读:
    6-8 adaboost分类器2
    6-7 adaboost分类器1
    6-6 Haar特征3
    6-5 Haar特征2
    6-4 Haar特征1
    6-3 图片合成视频
    6-2 视频分解图片
    Linux操作系统六大优点
    Linux系统正则表达式用法笔记
    Linux系统正则表达式用法笔记
  • 原文地址:https://www.cnblogs.com/HHR-SUN/p/7132977.html
Copyright © 2020-2023  润新知