Nailed it! ;-)

Thanks

Fabio
_____________________
Fabio Nunes - NAVITA
Diretor de Engenharia de Software
Fone:    55 48 225-5396
Celular: 55 48 9119-9918
http://www.navita.com.br


----- Original Message -----
From: "Sean A Corfield" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 09, 2004 3:14 PM
Subject: Re: [CFCDev] Caching...


> On Jan 9, 2004, at 9:32 AM, Fabio Nunes wrote:
> > The problem: sometimes, when first loading, in a multi-threaded
> > enviroment,
> > the element myAccessControlAgent doesn't get defined on this, throwing
> > an
> > error when we try to use it.
>
> If you add in the <cfelse> for the nested <cfif> you'll see why...
>
> >  <!--- accessControlAgent --->
> >  <cfif NOT IsDefined("Application.accessControlAgent") OR NOT
> > IsStruct(Application.accessControlAgent)>
> >
> >       <cflock name="accessControlAgent" timeout="120"
> > throwontimeout="Yes"
> > type="EXCLUSIVE">
> >            <cfif NOT IsDefined("Application.accessControlAgent") OR NOT
> > IsStruct(Application.accessControlAgent)>
> >
> >         <cfinvoke component="#this.cfcroot#.model.accesscontrolagent"
> > method="createAccessControlAgent" dsn="#this.dsn#"
> > factoryType="#this.dbtype#" cfcroot="#this.cfcroot#"
> > returnvariable="this.myAccessControlAgent">
> >             <cfset Application.accessControlAgent =
> > this.myAccessControlAgent>
>
> <cfelse>
> What do you do in this case?
> Should have:
> <cfset this.myAccessControlAgent = Application.accessControlAgent>
> >        </cfif>
> >       </cflock>
> >
> >  <cfelse>
> >           <cfset this.myAccessControlAgent =
> > Application.accessControlAgent>
> >  </cfif>
>
> You have a path through the code that doesn't set anything (unless you
> add in that <cfelse>)
>
> Sean A Corfield -- http://www.corfield.org/blog/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
> in the message of the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
>
> An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]
>
>


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to