【问题标题】:Cache already exists error with CFCACHECFCACHE 的缓存已存在错误
【发布时间】:2014-12-12 10:38:25
【问题描述】:

我最近使用 CFCACHE 在冷融合 9 服务器上实现页面缓存。

但是,我在负载(运行自动链接检查器)时收到错误报告,例如: "缓存 A95C0BF9E9BFBC6F151F03E939D2D2D6TEMPLATE 已经存在"

我曾认为 cfcache 将是线程安全的,并且无需任何额外代码即可处理此问题。如果它是相关的,我会在我的 application.cfc 中的“OnRequest”中调用它。在我看来,这可能是一个 Cold Fusion 错误,但也有可能我以某种方式滥用了 CFCACHE 机制。

<!--- setup caching if enabled --->
<cfif getConfigValue('page_cache') eq "true" and not application.security.isLoggedOn()>
    <cfcache timespan="#createTimeSpan(0,0,10,0)#" directory="#application.pagecachepath#" usequerystring="true" >
</cfif>
<!--- Call request handling and rendering functions --->
<cfcontent reset="yes" type="text/html"><cfoutput>#html.render()#</cfoutput>
<cfif getConfigValue('page_cache') eq "true" and not application.security.isLoggedOn()><!-- content generated at #Now()#--></cfif>

堆栈跟踪是:

    net.sf.ehcache.ObjectExistsException: Cache A95C0BF9E9BFBC6F151F03E939D2D2D6TEMPLATE already exists at 
    net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:920) at 
    net.sf.ehcache.CacheManager.addCache(CacheManager.java:915) at 
    net.sf.ehcache.CacheManager.addCache(CacheManager.java:870) at 
    coldfusion.tagext.io.cache.ehcache.GenericEhcache.createCache(GenericEhcache.java:317) at 
    coldfusion.tagext.io.cache.ehcache.GenericEhcache._getCache(GenericEhcache.java:301) at 
    coldfusion.tagext.io.cache.ehcache.GenericEhcache.getCache(GenericEhcache.java:268) at 
    coldfusion.tagext.io.cache.ehcache.GenericEhcache.get(GenericEhcache.java:72) at 
    coldfusion.tagext.io.cache.CacheTagHelper.checkFromTemplateCache(CacheTagHelper.java:56) at 
    coldfusion.tagext.io.cache.CacheTag.checkTemplatecache(CacheTag.java:695) at 
    coldfusion.tagext.io.cache.CacheTag.doStartTag(CacheTag.java:609) at 
    coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at cfapplication2ecfc814216694$funcONREQUEST._factor1(C:\inetpub\vhosts\example.org\httpdocs\application.cfc:190) at 
    cfapplication2ecfc814216694$funcONREQUEST.runFunction(C:\inetpub\vhosts\example.org\httpdocs\application.cfc:187) at 
    coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at 
    coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at  
    coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at

如果没有更好的想法,我想我会开始研究 EH 缓存源!

【问题讨论】:

    标签: coldfusion coldfusion-9 cfcache


    【解决方案1】:

    coldfusion.tagext.io.cache.ehcache.GenericEhcache 中的竞争条件

    看起来它在 CF9 和 10 中都存在(基于源代码)

    您唯一的解决方案是将 cflock 放在某个地方自己解决此问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多