The below works. What if I cache the component itself in the application scope outside 
of the CFC would that keep it from
reading from the config file everytime? So far it seems that even if the component is 
cached it still calls the init function
everytime.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Nathan Dintenfass
Sent: Thursday, October 16, 2003 11:28 AM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] Initialize only once


Well, at some point you'll need to put something in a persistent memory
scope if you want it to stick around from request to request (assuming you
don't want to read it off the file system/network every time).  My initial
suggestion about the server scope was, in fact, to use it internal to the
CFC.  So, something like:

<cffunction name="init">
<cfif NOT structKeyExists(server,"myCFCConfig")>
DO CONFIG
</cfif>
<cfset variables.config = server.myCFCConfig>
</cffunction>

Again, this is not really a best practice, but if you really want it to be
"inside" your CFC you'll need to do something along those lines.


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