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]

Reply via email to