Could you share more of your code that you are using in your listener? Are you using any modules? There is a CacheManager for the base application and one for each module.

I guess I'm confused by this piece of code that you shared:

<cfif StructKeyExists(variables.handlersByAliases, getKeyHash(arguments.alias))>


To clear a cache from a listener, the code would be something like:

<cfset getAppManager().getCacheManager().clearCachesByAlias("alias", arguments.event, "ListOfCriteria") />

Or in your case:

<cfset getAppManager().getCacheManager().clearCachesByAlias(arguments.event.getArg("alias"), arguments.event, "") />

As for the CacheClearCommand.cfc, it is not doing anything special for you:

http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/browser/framework/1-8-0/trunk/framework/commands/CacheClearCommand.cfc

Best,
.Peter

Jeremy.Shearer said the following on 11/02/10 10:59:
Currently I have an event in a module that clears the cache for a
specific alias:

<cache-clear aliases="homePage"/>

I can see in the mach-ii logging where it hits the
CacheManager.clearCachesByAlias trace statements and clears the cached
items in the homePage alias.

I would like to be able to pass in the alias in an event arg, but I
can't just do<cache-clear aliases="${event.alias}"/>

So I moved it into a listener,

<cfif StructKeyExists(variables.handlersByAliases,
getKeyHash(arguments.alias))>

I added some of my own trace statements into the clearCachesByAlias
function and I can see them in the output, but this line returns false
and so nothing gets cleared from the c

ache:
<cfif StructKeyExists(variables.handlersByAliases,
getKeyHash(arguments.alias))>

Is there something special that the CacheClearCommand.cfc sets up that
I'm not getting by calling clearCachesByAlias() directly from my
listener?


--
You received this message because you are subscribed to Mach-II for CFML list.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
SVN: http://greatbiztoolsllc.svn.cvsdude.com/mach-ii/
Wiki / Documentation / Tickets: 
http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/

Reply via email to