惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog
Microsoft Security Blog
Microsoft Security Blog
Jina AI
Jina AI
博客园 - 叶小钗
J
Java Code Geeks
博客园 - 聂微东
博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
美团技术团队
WordPress大学
WordPress大学
M
MIT News - Artificial intelligence
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
罗磊的独立博客
T
The Blog of Author Tim Ferriss
aimingoo的专栏
aimingoo的专栏
T
Tailwind CSS Blog
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
小众软件
小众软件

博客园 - 冰绿茶

关于NHibernate、Castle和WCF做分布式事务时发生异常的解决办法 数据绑定控件和XmlDataSource控件结合使用,通过后台绑定Xml数据片段遇到的问题 微软StockTrader 2.03 学习笔记(8)--配置服务实现示例指南(四) 微软StockTrader 2.03 学习笔记(7)--配置服务实现示例指南(三) 微软StockTrader 2.03 学习笔记(6)--配置服务实现示例指南(二) 微软StockTrader 2.03 学习笔记(5)--配置服务实现示例指南(一) 微软StockTrader 2.03 学习笔记(4)--配置数据库生成工具介绍 SQLServer实战经验分享--ServiceBroker安全配置和使用示例 ASP.NET Trick文章系列--使用State Server管理Session状态的另类经济用法 微软StockTrader 2.03 学习笔记(3)--配置网站和配置服务在StockTrader中的使用示例 在数据库事务设计中经常会遇到的疑惑 微软StockTrader 2.03 学习笔记(2)--什么是配置网站和配置服务、配置存储库 微软StockTrader 2.03 学习笔记(1)--学习大纲整理 asp.net 2.0页面性能的考虑--异步页面处理模型 Asp.net 2.0 动态加载其他子目录用户控件问题 Web 下配置文件信息的读写 .net 2.0 中对配置文件的读写 ASP.NET 2.0加密网站配置文件中的信息 - 冰绿茶 - 博客园 Understanding ASP.NET Provider Model (Creating Custom Membership and Role Providers) - Part 3
解决Ehcache缓存警告问题
冰绿茶 · 2014-07-08 · via 博客园 - 冰绿茶

警告: Creating a new instance of CacheManager using the diskStorePath "D:\Apache Tomcat 6.0.18\temp" which is already used by an existing CacheManager.
The source of the configuration was classpath.
The diskStore path for this CacheManager will be set to D:\Apache Tomcat 6.0.18\temp\ehcache_auto_created_1262783591937.
To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache.xml) for each CacheManager instance.

需要设置2个地方解决这个问题

1.hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory

注意需要是Singleton的EhCacheRegionFactory

2.Spring EhCache Beans配置

<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
<property name="cacheManager" ref="ehcache"/>
</bean>

<bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="shared" value="true"/>
<property name="configLocation" value="classpath:ehcache.xml"/>
</bean>

注意这里一定要设置shared为true