Bryan,

If you show us some code of how you are putting the CFC instance into a
persistent scope then we might be able to see what's going on.

Doing something like this works perfectly well:

<cfif NOT structKeyExists(application,"myPersistedCFC")>
        <cflock scope="application" type="exclusive" timeout="10">
                <cfif NOT structKeyExists(application,"myPersistedCFC")>
                        <cfscript>
                        //Create our context CFC
                        myCFC =
createObject("component","com.myCompany.myCFC");
                        //Initialise
                        myCFC.init()
                        //Put in application scope
                        application.myPersistedCFC = myCFC;
                        </cfscript>     
                </cfif>
        </cflock>
</cfif>

i.e. are you checking for the existence of your CFC in the persistent
scope on each request or are you just instantiating it from scratch each
time which makes the persistent scope redundant?

Andr�

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf
> Of Bryan F. Hogan
> Sent: 17 October 2003 16:41
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] Initialize only once
> 
> I agree, however caching the component itself does not make a
differance
> for some reason.
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Nathan Dintenfass
> Sent: Friday, October 17, 2003 9:38 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] Initialize only once
> 
> 
> Yes -- instance variables last only as long as the instance does.
Thus,
> if
> the instance is not cached from request to request the instance vars
will
> not be cached.  You will need either put the variables in a shared
memory
> scope (not suggested), put the instance in a shared memory scope (very
> acceptable), or use some other component/variable in a shared memory
scope
> that you pass to your component when you init().
> 
> 
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the word '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 word '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