jpa-入门.缓存配置ehcache.xml
<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.
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 -->
<diskStore path="java.io.tmpdir"/>
<!--Default Cache configuration. These will applied to caches programmatically created through
the CacheManager.
The following attributes are required for defaultCache:
maxInMemory - 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.
timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only used
if the element is not eternal. Idle time is now - last accessed time
timeToLiveSeconds - Sets the time to live for an element before it expires. Is only used
if the element is not eternal. TTL is now - creation time
overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache
has reached the maxInMemory limit.
-->
<defaultCache
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
/>
<!--Predefined caches. Add your cache configuration settings here.
If you do not have a configuration for your cache a WARNING will be issued when the
CacheManager starts
The following attributes are required for defaultCache:
name - Sets the name of the cache. This is used to identify the cache. It must be unique.
maxInMemory - 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.
timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only used
if the element is not eternal. Idle time is now - last accessed time
timeToLiveSeconds - Sets the time to live for an element before it expires. Is only used
if the element is not eternal. TTL is now - creation time
overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache
has reached the maxInMemory limit.
-->
<!-- Sample cache named sampleCache1
This cache contains a maximum in memory of 10000 elements, and will expire
an element if it is idle for more than 5 minutes and lives for more than
10 minutes.
If there are more than 10000 elements it will overflow to the
disk cache, which in this configuration will go to wherever java.io.tmp is
defined on your system. On a standard Linux system this will be /tmp"
-->
<cache name="sampleCache1"
maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="300"
timeToLiveSeconds="600"
overflowToDisk="true"
/>
<!-- Sample cache named sampleCache2
This cache contains 1000 elements. Elements will always be held in memory.
They are not expired. -->
<cache name="sampleCache2"
maxElementsInMemory="1000"
eternal="true"
timeToIdleSeconds="0"
timeToLiveSeconds="0"
overflowToDisk="false"
/> -->
<!-- Place configuration for your caches following -->
</ehcache>
jpa-入门.缓存配置ehcache.xml的更多相关文章
- 缓存初解(三)---Spring3.0基于注解的缓存配置+Ehcache和OScache
本文将构建一个普通工程来说明spring注解缓存的使用方式,关于如何在web应用中使用注解缓存,请参见: Spring基于注解的缓存配置--web应用实例 一.简介 在spring的modules包中 ...
- 缓存初解(四)---Ibatis的缓存配置+Ehcache
项目完结,整理一些技术方面的相关收获. 已经记不得EhCacheController这个实现类最早来自于那里了,总之稍加修改后非常有效果,大家就这么用了,感谢最初开源的那位兄弟.这里,主要是做个记录, ...
- Spring Data JPA 缓存结合Ehcache介绍
一级缓存: 会话session.事务级别的,事务退出,缓存就失效了. 实体管理器在事务执行期间持有一份数据的拷贝,而非直接操作数据源. 二级缓存: 进程范围级或集群范围的缓存,这个级别的缓存可配置和修 ...
- Spring Boot 缓存应用 Ehcache 入门教程
Ehcache 小巧轻便.具备持久化机制,不用担心JVM和服务器重启的数据丢失.经典案例就是著名的Hibernate的默认缓存策略就是用Ehcache,Liferay的缓存也是依赖Ehcache. 本 ...
- 缓存插件 EHCache 对象缓存(Spring)
对象缓存就是将查询的数据,添加到缓存中,下次再次查询的时候直接从缓存中获取,而不去数据库中查询. 对象缓存一般是针对方法.类而来的,结合Spring的Aop对象.方法缓存就很简单.这里需要用到切面编程 ...
- Spring控制Hibernate的缓存机制ehcache
首先在spring.xml中进入bean <prop key="hibernate.cache.use_second_level_cache">true</pro ...
- 缓存初解(五)---SpringMVC基于注解的缓存配置--web应用实例
之前为大家介绍了如何使用spring注解来进行缓存配置 (EHCache 和 OSCache)的简单的例子,详见 Spring基于注解的缓存配置--EHCache AND OSCache 现在介绍一下 ...
- 缓存之EHCache(转)
一.简介非常简单,而且易用. ehcache 是一个非常轻量级的缓存实现,而且从1.2 之后就支持了集群,而且是hibernate 默认的缓存provider.ehcache 是一个纯Java的进程内 ...
- spring+springMVC+JPA配置详解(使用缓存框架ehcache)
SpringMVC是越来越火,自己也弄一个Spring+SpringMVC+JPA的简单框架. 1.搭建环境. 1)下载Spring3.1.2的发布包:Hibernate4.1.7的发布包(没有使用h ...
随机推荐
- Linux Shell查看物理CPU个数、核数、逻辑CPU个数
Linux Shell常用命令: ====================================== # 总核数 = 物理CPU个数 X 每颗物理CPU的核数 # 总逻辑CPU数 = 物理C ...
- 清华集训2016Day4
清华集训2016Day4 组合数问题(problem) 用卢卡斯定理可知满足条件即将\(n\)和\(m\)分别用\(k\)进制表示,要求\(n\)的每一位都要大于等于\(m\)的对应位.直接数位\(d ...
- systemd开机启动
SUMMARY = "rvc_os temporary version" HOMEPAGE = "http://www.desay-svautomotive.com&qu ...
- Drupal 7 建站学习手记(五):QuickTabs模块内的元素无法溢出的问题
背景 项目要求站点首页放Views生成的区块,而且要求有很多其它链接. Views生成的区块默认的很多其它链接仅仅能选在列表上方和下方 下图是默认在上方的样式图: 为了美观.我将很多其它链接上移了若干 ...
- 实战:mysql检查物理磁盘中的二进制日志文件是否有丢失
版权声明:日常札记,乐于分享 https://blog.csdn.net/yangzhawen/article/details/32103555 场景:有时候由于磁盘损坏或人为原因错误删除了磁盘中的二 ...
- 哈勃(Hubble)望远镜的新发现
请看下图: itok=FcRLe7t_" name="图形1" alt="" border="0" height ...
- Spark的启动进程详解
Master和Worker是执行任务之前存在的进程 (类似于公司) Driver和Excutor是任务执行之后存在的进程(类似于公司接到项目后才成立的项目小组) 启动步骤: 启动Master资源管理进 ...
- Windows 10 子系统 Ubuntu 中安装 FastAdmin
Windows 10 子系统 Ubuntu 中安装 FastAdmin 打开 Windows 10 子系统 安装 Ubuntu 修改安装源为阿里的 %LOCALAPPDATA%\Packages\Ca ...
- lamba数据架构以及数据湖
面试大数据项目,面试过程中发现面试官提到的两个概念没有搞清楚: 1. lamba数据架构:这个概念的提出是由storm的作者提出来的,其实主旨就是想要说明,数据的处理分成三层,一类是批处理程序(bat ...
- jp@gc - Stepping Thread Group 字段说明
1. 安装好插件 参考文档“扩展Jmeter插件获取更多监听器” 2. 添加线程组 右键测试计划->添加->Threads(Users)->jp@gc - Stepping ...