Hi....

We have a Bussiness Delegate that calls a fa�ade for the bussiness logic.

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.

This is the code in the BD's pseudo-constructor

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

       </cfif>
      </cflock>

 <cfelse>
          <cfset this.myAccessControlAgent = Application.accessControlAgent>
 </cfif>


We get the error message here

 <!--- contentmanagement services --->
 <cfif NOT IsDefined("Application.contentManager") OR NOT
IsStruct(Application.contentManager)>

      <cflock name="contentmanagement" timeout="120" throwontimeout="Yes"
type="EXCLUSIVE">
       <cfif NOT IsDefined("Application.contentManager") OR NOT
IsStruct(Application.contentManager)>
        <cfinvoke component="#this.cfcroot#.model.contentmanagementservices"
method="create" dsn="#this.dsn#" cfcroot="#this.cfcroot#"
mapping="#this.mapping#" returnvariable="this.myContentManager"
factoryType="#this.dbtype#" webroot="#this.webroot#"
accessControlAgent="#this.myAccessControlAgent#"
editmodeViewer="#this.myEditmodeViewer#">

        <cfset Application.contentManager = this.myContentManager>
       </cfif>
      </cflock>

 <cfelse>
      <cfset this.myContentManager = Application.contentManager>
 </cfif>


Any ideas?

Fabio

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


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