clear-cache

3 views
Skip to first unread message

jlcox

unread,
Sep 3, 2008, 2:12:11 PM9/3/08
to Mach-II for CFML
I'm trying out the 1.6 caching for the first time, having trouble with
something that seems that it should be straightforward.

Declaration:

<property name="Caching" type="MachII.caching.CachingProperty">
<parameters>
<parameter name="defaultCacheName" value="default" />
<parameter name="default">
<struct>
<key name="type"
value="MachII.caching.strategies.TimeSpanCache" />
<key name="scope" value="application" />
<key name="timespan" value="0,1,0,0" />
<key name="cleanupIntervalInMinutes" value="3" />
</struct>
</parameter>
</parameters>
</property>

Then I cache my home page:

<event-handler event="home" access="public">
<cache alias="homePage">
<notify listener="adminListener" method="getNews"
resultArg="results"/>
<view-page name="home" contentArg="content"/>
</cache>
<execute subroutine="page.build.main"/>
</event-handler>

I hit the page several times and confirm that the cache is working by
using the groovy new Dashboard. One hit for each reload, plus a miss
for the initial load.

Now, I try to clear the cache...

<event-handler event="news.update" access="public">
<event-bean name="newsBean" type="newsBean"/>
<notify listener="adminListener" method="saveNewsItem"/>
<cache-clear alias="homePage" />
<redirect event="news"/>
</event-handler>

and I get this:


Exception
Element homePage is undefined in a CFML structure referenced as part
of an expression.

C:\Inetpub\wwwroot\MachII_1.6\framework\CacheHandler.cfc (216)
C:\Inetpub\wwwroot\MachII_1.6\framework\CacheManager.cfc (289)

How did I mess this up?
Message has been deleted

Kurt Wiersma

unread,
Sep 3, 2008, 8:18:40 PM9/3/08
to mach-ii-for...@googlegroups.com
Jonah posted a work around but I think this maybe a bug. Are you running latest BER?

--Kurt

On Wed, Sep 3, 2008 at 5:59 PM, .jonah <pixe...@gmail.com> wrote:

Quick answer:

  <cache-clear name="default" />

.jonah

unread,
Sep 3, 2008, 8:45:36 PM9/3/08
to Mach-II for CFML
I think you're right. Didn't post a response - confirming.

But if you Change line 216 in CacheHandler.cfc in the clearCache
function to:

from:
<cfloop list="#variables.aliasKeyLists[currentAlias]#"
index="currentKey">
to:
<cfloop list="#variables.aliasKeyLists[hash(currentAlias)]#"
index="currentKey">

It appears to work.

I'll submit the bug.


On Sep 3, 5:18 pm, "Kurt Wiersma" <kwier...@gmail.com> wrote:
> Jonah posted a work around but I think this maybe a bug. Are you running
> latest BER?
> --Kurt
>

.jonah

unread,
Sep 3, 2008, 8:53:10 PM9/3/08
to Mach-II for CFML
But actually, it should probably be doing the hashing elsewhere. I
haven't studied the new caching code yet.

.jonah

unread,
Sep 3, 2008, 10:20:55 PM9/3/08
to Mach-II for CFML
Here's a fix:
http://greatbiztoolsllc-trac.cvsdude.com/mach-ii/ticket/130

On Sep 3, 11:12 am, jlcox <jl...@goodyear.com> wrote:

jlcox

unread,
Sep 4, 2008, 9:02:43 AM9/4/08
to Mach-II for CFML
The fix works, thanks!
Reply all
Reply to author
Forward
0 new messages