
ehcache
我家小宝_朱朱
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
CacheManager.create和springmvc ehcache 冲突
描述: CacheManager.create 指定了ehcache配置文件,可是总是读取springmvc中配置的ehcache 原因: 在EhCache2.5版本以上 同一个JVM当中不允许出现俩个相同名字的CacheManager 否则会报错。 解决: 在ehcache配置,通过name来区分 红色部分。ehcache.xml配置文件取不同的name就可以 <ehcac转载 2016-09-09 10:35:33 · 1220 阅读 · 0 评论 -
Ehcache整合spring配置
为了提高系统的运行效率,引入缓存机制,减少数据库访问和磁盘IO。下面说明一下ehcache和spring整合配置。 1. 需要的jar包 slf4j-api-1.6.1.jar ehcache-core-2.1.0.jar ehcache-spring-annotations-1.1.2.jar slf4j-log4j12-1.6.1.jar spr转载 2016-09-09 10:56:22 · 585 阅读 · 0 评论 -
ehcache中xml配置
maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" maxElementsOnDisk="10转载 2016-08-31 11:31:02 · 567 阅读 · 0 评论 -
单独使用EHCache
1.创建CacheManager (net.sf.ehcache.CacheManager) (1)使用默认配置文件创建 1 CacheManager manager = CacheManager.create(); (2)使用指定配置文件创建 1 CacheManager manager =转载 2016-08-31 11:41:36 · 618 阅读 · 0 评论 -
EhcacheUtil工具类
EhcacheUtil工具类使用: public class EhcacheUtil { private static final String path = "/ehcache.xml"; private URL url; private CacheManager manager; priv转载 2016-08-31 14:13:31 · 1527 阅读 · 0 评论 -
关于ehcache的timeToLiveSeconds和timeToIdleSeconds
这两个参数很容易误解,看文档根本没用,我仔细分析了ehcache的代码。结论如下: 1、timeToLiveSeconds的定义是:以创建时间为基准开始计算的超时时长; 2、timeToIdleSeconds的定义是:在创建时间和最近访问时间中取出离现在最近的时间作为基准计算的超时时长; 3、如果仅设置了timeToLiveSeconds,则该对象的超时时间=创建时间+timeT转载 2016-09-08 15:30:39 · 1679 阅读 · 2 评论