zoukankan      html  css  js  c++  java
  • 二级缓存插件

    二级缓存插件(都有相应的jar包)有:

    EhCache:属于后台缓存技术    比较常用   

    OSCache:属于页面缓存技术    比较常用

    SwarmCache

    IBossCache

    使用二级缓存插件都要导入相应的jar包后才能使用

    ehcache 是缓存小框架 是hibernate采用的默认缓存技术 存取数据 高效   ehcache 是为了重复读取数据 而提供的支持  ehcache 能装各种数据

    hibernate缓存又分为一级缓存和二级缓存    二级缓存(SessionFactory:一般情况下:一个SessionFactory对应一个数据库)

    开启二级缓存有二种方法:

    1.注解:类上加@cache

    2.配置:<cache  />  在核心配置文件内copy  hibernate.properties 内对应内容 比如:

    <?xml version="1.0" encoding="UTF-8"?>
    <ehcache>
      <!-- ehcache 是 缓存工具。 为了重复读取数据 提供支持 ,默认的hibernate的缓存技术.ehcache 能装各种数据-->
      <diskStore path="D:/aaa"/>
      <cache
        name="myCache"
        maxElementsInMemory="2"
        eternal="false"
        timeToIdleSeconds="120"
        timeToLiveSeconds="120"
        overflowToDisk="true"
        diskPersistent="false"
        diskExpiryThreadIntervalSeconds="120"
        memoryStoreEvictionPolicy="LFU"
      />
      <defaultCache
        maxElementsInMemory="10000"
        eternal="false"
        timeToIdleSeconds="120"
        timeToLiveSeconds="120"
        overflowToDisk="true"
        diskPersistent="false"
        diskExpiryThreadIntervalSeconds="120"
        memoryStoreEvictionPolicy="LRU"
        />
    </ehcache>

  • 相关阅读:
    tar.xz文件格式的压缩与解压
    touch命令创建文件
    ls命令
    redis中键空间通知
    socket.io笔记三之子命名空间的socket连接
    Java内部类的使用小结
    如何禁用Chrome浏览器的Flash
    Hibernate Tools插件的安装和使用
    JDBC DataSource
    Tomcat中用JNDI方式加载JDBC DataSource以连接数据库
  • 原文地址:https://www.cnblogs.com/hwgok/p/5393861.html
Copyright © 2011-2022 走看看