NutzCN Logo
问答 关于nutz-cache插件中使用ehcache的配置
发布于 3113天前 作者 Rekoe 3013 次浏览 复制 上一个帖子 下一个帖子
标签: ehcache cache dao

如果使用ehcache的话 ehcache中配置的缓存名如何和cache插件中的名字对应上?

11 回复

那 那些不在ehcache中配置 就是走默认的

	<defaultCache maxElementsInMemory="1000" eternal="false"
		timeToIdleSeconds="3600" timeToLiveSeconds="3600" overflowToDisk="false"
		diskPersistent="false" diskExpiryThreadIntervalSeconds="120"
		statistics="false" />

配置么

我搜了下 这个key shiro-activeSessionCache 怎么没找到用的地方

	<cache name="shiro-activeSessionCache"
       maxElementsInMemory="1000"
       overflowToDisk="true"
       eternal="true"
       timeToLiveSeconds="0"
       timeToIdleSeconds="0"
       diskPersistent="true"
       diskExpiryThreadIntervalSeconds="600"/>

@wendal

另外ehcache.js中配置的 这个nutzbook key在ehcache中没找到
args : ["nutzbook"] // 对应shiro.ini中指定的ehcache.xml中定义的name

var ioc = {
		cacheManager : {
			type : "net.sf.ehcache.CacheManager",
			factory : "net.sf.ehcache.CacheManager#getCacheManager",
			args : ["nutzbook"] // 对应shiro.ini中指定的ehcache.xml中定义的name
		}
};

@wendal
我看的就是这个dao.js 最终引用的还是ehcache.js这个

["nutzbook"] 指的是ehcache.xml这个文件里面, 开头部分的name属性

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="false"
	monitoring="autodetect" dynamicConfig="true" name="nutzbook"> // 这个name=的值

@wendal
好了 知道 它指向的是哪个应用了

看来得补充一下daocache的README

添加回复
请先登陆
回到顶部