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”/>
hibernate配置二级缓存的更多相关文章
- (转)为Spring集成的Hibernate配置二级缓存
http://blog.csdn.net/yerenyuan_pku/article/details/52896195 前面我们已经集成了Spring4.2.5+Hibernate4.3.11+Str ...
- Hibernate中"二级缓存"配置
实体类 : package cn.happy.entity; public class Emp { private Integer empNo; private String empName; pub ...
- Hibernate之二级缓存
Hibernate之二级缓存 一.简介 Gaving King曾经对别人说,hibern ...
- hibernate(九) 二级缓存和事务级别详讲
序言 这算是hibernate的最后一篇文章了,下一系列会讲解Struts2的东西,然后说完Struts2,在到Spring,然后在写一个SSH如何整合的案例.之后就会在去讲SSM,在之后我自己的个人 ...
- hibernate的二级缓存
缓存(Cache): 计算机领域非常通用的概念.它介于应用程序和永久性数据存储源(如硬盘上的文件或者数据库)之间,其作用是降低应用程序直接读写永久性数据存储源的频率,从而提高应用的运行性能.缓存中的数 ...
- 不要依赖hibernate的二级缓存
一.hibernate的二级缓存 如果开启了二级缓存,hibernate在执行任何一次查询的之后,都会把得到的结果集放到缓存中,缓存结构可以看作是一个hash table,key是数据库记录的id ...
- SSH整合缓存之-Memcached作为hibernate的二级缓存
Hibernate本身不提供二级缓存,所以需要使用第三方插件来作为二级缓存:本次使用memcached作为Hiberbate的二级缓存:添加步骤如下: 一.需要安装memcached服务端 1. 下载 ...
- Hibernate4+EhCache配置二级缓存
本文主要讲一讲Hibernate+EhCache配置二级缓存的基本使用方法 (有关EhCache的基础介绍可参见:http://sjsky.iteye.com/blog/1288257 ) Cache ...
- Hibernate的二级缓存策略
Hibernate的二级缓存策略的一般过程如下: 1) 条件查询的时候,总是发出一条select * from table_name where …. (选择所有字段)这样的SQL语句查询数据库,一次 ...
随机推荐
- wordpress引入文件
引入顶部 <?php get_header(); ?> 引入侧栏 <?php get_sidebar(); ?> 引入底部 <?php get_footer(); ?&g ...
- xhprof 运行结果名词解释
Overall Summary Inclusive Time (或子树时间):包括子函数所有执行时间. Exclusive Time/Self Time:函数执行本身花费的时间,不包括子树执行时间. ...
- RestTemplate之GET和POST调用和异步回调
get方式 String url = "http://hostname:port/v1.0/data/data"; HttpHeaders headers = new HttpHe ...
- 04、常用RDD操作整理
常用Transformation 注:某些函数只有PairRDD只有,而普通的RDD则没有,比如gropuByKey.reduceByKey.sortByKey.join.cogroup等函数要根据K ...
- 02、创建RDD(集合、本地文件、HDFS文件)
Spark Core提供了三种创建RDD的方式,包括:使用程序中的集合创建RDD:使用本地文件创建RDD:使用HDFS文件创建RDD. 1.并行化集合 如果要通过并行化集合来创建RDD,需要针对程序中 ...
- MFC中使用ATL报错:error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
我在MFC中使用ATL函数A2W的时候报如下的错误: error C4430: missing type specifier - int assumed. Note: C++ does not sup ...
- html : 九宫格(响应式)
talk is cheap, show you the code : <!DOCTYPE html> <html> <head> <title>html ...
- Mac NVM 配置
1.NVM 简介 NVM(node version manager)是一个可以让你在同一台机器上安装和切换不同版本 node 的工具. GitHub 地址 2.NVM 环境配置 2.1 安装 NVM ...
- Atitit 项目版本管理gitflow 与 Forking的对比与使用
Atitit 项目版本管理gitflow 与 Forking的对比与使用 1.1. 版本管理的历史 csv>>svn >git 1 1.2. gitflow的核心是分版本管理,for ...
- iOS开发之duplicate symbols for architecture x86_64错误
[主要内容:] 1. 错误提示 2. 分析错误原因 3. 解决问题办法 一.错误提示 在我们写代码过程中可能会经常遇到这样一个错误: <span style="font-size: ...