Afternoon Folks,

I'm hoping one of you can help me clear something up.  I have an event that
is caching data by criteria and also have two event args that are used to
get the cache aliases:

<event-arg name="cacheAlias_Sub" value="constituentDataSubmited" />
<event-arg name="cacheAlias_IP" value="constituentDataInProcess" />
<cache alias="constituentDataSubmited" criteria="${event.applicationUUID}">
<notify listener="applicantListener" method="getApplicants"
resultArg="submittedApplicants" />
</cache>
<cache alias="constituentDataInProcess" criteria="${event.applicationUUID}">
<notify listener="applicantListener" method="getApplicants"
resultArg="inProcessApplicants" />
</cache>

Prior to those two caches I notify a listener to see if I need to clear the
caches:

<notify listener="appListener" method="clearCacheByAlias" />

I modified the cache clearing example from the IntroToCaching WIKI.  In my
case, if the value of clearCache (which gets is value from the CV event arg)
is "1"  then the two caches are to be cleared.  Here is my code:

<cffunction name="clearCacheByAlias" access="public" returntype="string"
output="false">
<cfargument name="event" type="MachII.framework.Event" required="true">

     <cfset var cacheAlias_Sub = event.getArg('cacheAlias_Sub')/>
     <cfset var cacheAlias_IP = event.getArg('cacheAlias_IP')/>
     <cfset var cacheManager = ""/>
     <cfset var clearCache = arguments.event.getArg('cv',0) />
     <cfset var applicationUUID = arguments.event.getArg('applicationUUID')
/>

     <cfif clearCache>
     <cfset cacheManager = getAppManager().getCacheManager() />

          <cfset
cacheManager.clearCachesByAlias(cacheAlias_Sub,arguments.event,applicationUUID)/>
          <cfset
cacheManager.clearCachesByAlias(cacheAlias_IP,arguments.event,applicationUUID)/>
     </cfif>
</cffunction>

Even though at times I pass in cv=1 to the event neither cache is being
updated.  I can't see/figure out what I'm missing.

Thanks
Derrick

-- 
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