Hey Peter,

The only module I have in my app is the Dashboard.  The listener is in the
base app and is not being used in the Dashboard module.  What I did notice
when I started using multiple caching strategies is the named strategy I
want to clear on occasion never shows any hits in the dashboard.  The
default strategy shows hits increasing but not "ConData_Cache" strategy.
I've included the event in question in case I'm doing things in there that I
should not be.

<event-handler event="showApplication" access="public">
<event-arg name="pageTitle" value="Constituent Data" />
<execute subroutine="getApplicationData" />
<notify listener="appListener" method="clearCacheByAlias" /> (this is named
clearCacheByAlias, but its actually clearing by strategy. I just forgot to
change the name)
<cache strategy="ConData_Cache" criteria="${event.applicationUUID}" >
<event-arg name="applicantStatus" value="1" />
<notify listener="applicantListener" method="getApplicants"
resultArg="submittedApplicants" />
<event-arg name="applicantStatus" value="0" />
<notify listener="applicantListener" method="getApplicants"
resultArg="inProcessApplicants" />
</cache>
<cache alias="constituentDataQuestion" criteria="${event.applicationUUID}">
<notify listener="questionListener" method="getQuestionsByApplicationUUID"
resultArg="questionList"/>
<notify listener="answerListener" method="getAnswersToQuestions"
resultArg="questionAnswerList" />
<notify listener="answerListener" method="getAnswersByApplicationUUID"
resultArg="constituentAnswers"/>
</cache>
<view-page name="constituentData.applicantList" contentArg="content" />
<execute subroutine="mainTemplate" />
</event-handler>



On Wed, Mar 10, 2010 at 12:46 PM, Peter J. Farrell <[email protected]>wrote:

>  Derrick,  are you using modules?  If so, you need to talk to the right
> CacheManager.  There is a CacheManager for each module.  If your listener is
> in the base app and you are using that listener in a module  via module
> inheritance, than your listener is going to be talking to base app
> CacheManager.  I think this is the case.
>
> .pjf
>
> Derrick Jackson said the following on 10/03/10 11:16:
>
> I'm using the basic settings:  <property name="Caching"
> type="MachII.caching.CachingProperty"/>. I just switched to using multiple
> caching strategies and cached based on that.  in the listener I am now
> clearing by strategy name but this is not working either.  I find this very
> odd..
>
> On Wed, Mar 10, 2010 at 11:51 AM, Brian Pickens <
> [email protected]> wrote:
>
>> Well looking at the code you first posted, I'm not seeing the
>> strategyName attribute in your <cache/> nodes. Do you have your
>> defaultCacheName parameter defined? At this point I'm not sure whats
>> going on, we may need a MachII expert like Peter to chime in here. You
>> may want to post the cache property configuration as well.
>>
>> On Mar 10, 10:35 am, Derrick Jackson <[email protected]>
>> wrote:
>> > Thanks Brian.  I had the contents of the event emailed to me to be sure
>> > clearCache was set to 1 when I needed it to be.  The value was in fact
>> set
>> > to 1.  In that same email i decided to add the following:
>> > <cfdump var="#cacheManager.isAliasDefined(cacheAlias_Sub)# -
>> > #cacheManager.isAliasDefined(cacheAlias_IP)#"> to see if my aliases even
>> > exists. However, I get the following error:  variables.aliases doesn't
>> > exist.
>> >
>> > I was prompted to check the existence of my aliases when I was looking
>> over
>> > the logging output and saw the following:
>> >
>> > MachII.framework.CacheManager
>> >
>> > trace
>> >
>> > CacheManager clear cache for alias 'constituentDataSubmited', exists:
>> NO,
>> > criteria: FEECF20C-423D-4A41-846A3174C1A704A6
>> >
>> >  MachII.framework.CacheManager
>> >
>> > trace
>> >
>> > CacheManager clear cache for alias 'constituentDataInProcess', exists:
>> NO,
>> > criteria: FEECF20C-423D-4A41-846A3174C1A704A6
>> >
>> > Note it states that my two aliases do not exists.  Any thoughts on why
>> the
>> > aliases do not exists?
>> >
>> > On Wed, Mar 10, 2010 at 10:56 AM, Brian Pickens <
>> >
>> >
>> >
>>  > [email protected]> wrote:
>> > > Have you tried dumping 'clearCache' with an abort right after to make
>> > > sure the value is what it's supposed to be? That is where I would
>> > > start...
>> >
>> > > On Mar 9, 3:16 pm, Derrick Jackson <[email protected]>
>> > > wrote:
>> > > > 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,applicationU
>> > > UID)/>
>> > > >           <cfset
>> >
>> > >
>> cacheManager.clearCachesByAlias(cacheAlias_IP,arguments.event,applicationUU
>> > > ID)/>
>> > > >      </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/
>>
>>  --
>>  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/
>>
>
> --
> 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/
>
>
>  --
> 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/
>

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