No, Dave, I was only using it because I thought there might be some restriction on onApplicationStart. I even thought that maybe I couldn’t use ExpandPath, so I hardcoded the absolute location of the file: still no luck. I tried placing the values in the application scope; I thought that might be the problem, but I see you’re doing it in your code. Wow, now I’m more confused than ever! But thanks for trying to help me: I appreciate it.

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dave Shuck
Sent: Tuesday, October 17, 2006 10:48 PM
To: [email protected]
Subject: Re: [CFCDEV] Ray Camden talks about CFC

 

Hal,

I don't usually do this in OnApplicationStart(), and I have never tried this in OnRequest(), but I use this technique in OnRequestStart() on many of my apps.

<cfif NOT StructKeyExists(application,"Settings")>
    <cflock name="#application.applicationname#_Settings" type="exclusive" timeout="30">   
        <cfif NOT StructKeyExists(application,"Settings")>
        <cfscript>
        application.Settings = StructNew();
        application.Settings.Dsn = GetProfileString(ExpandPath("/ini/settings.ini.cfm"),"Database","Dsn");
        application.Settings.SomeOtherStuff = GetProfileString(ExpandPath("/ini/settings.ini.cfm"),"General","SomeOtherStuff");
        // etc.......
        </cfscript>
        </cfif>
    </cflock>
</cfif>

I am a little interested in the fact that you were using an OnRequest() method at all. Given the unique rules which apply if that method exists in an Application.cfc, is it possible that it could be a factor?  I have never found myself in a place where it was appropriate to have that method in my Application.cfc.

~Dave

On 10/17/06, Hal Helms <[EMAIL PROTECTED]> wrote:

Here's something that confuses me about Application.cfc. I recently decided to put a bunch of initial stuff in an .ini file. But when I tried to read that (using GetProfileString) from within OnApplicationStart(), it ignored it completely. I tried everything I could think of, moved the code into onRequest, changed the ini layout so that it was bad (it never threw an error). Finally, I gave up and used an XML file, which worked fine. But was this something I did wrong or is there some odd bug in the processing of Application.cfc?

 

Hal

 

From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Phillip Senn
Sent: Tuesday, October 17, 2006 3:31 PM
To: [email protected]
Subject: [CFCDEV] Ray Camden talks about CFC

 

Ray Camden is going to do another presentation on Application.cfc Wednesday at 5 CST.

 

 

http://ray.camdenfamily.com/index.cfm/2006/10/12/CFJUG-October-MeetingLast-Recording#c57ACA8B5-F394-7281-4821DCAFD4CBE4B0

 

http://ray.camdenfamily.com/index.cfm/2006/9/27/ColdFusion-Jedi-User-Group-Meeting-Tonight

 

 


You are subscribed to cfcdev. To unsubscribe, please follow the instructions at http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

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


You are subscribed to cfcdev. To unsubscribe, please follow the instructions at http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

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




--
~Dave Shuck
[EMAIL PROTECTED]
www.daveshuck.com

Where's your Spot?
www.instantspot.com
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

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


You are subscribed to cfcdev. To unsubscribe, please follow the instructions at http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

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

Reply via email to