On said diagnostic page, what is the value of CGI.SERVER_NAME and CGI.HTTP_HOST 
when the configName's value is "dev"?

-----Original Message-----
From: Dave Burns [mailto:cft...@burnsorama.com] 
Sent: Monday, March 28, 2011 1:10 PM
To: cf-talk
Subject: Re: What event specifically triggers OnApplicationStart?


>memory variables only timeout if they are not accessed the specified timeout
>period.
>every time anyone loads a page on your site, it accesses the application
>scope and their session scope, so the timeout is reset back to 0.
>
>An application will restart when ColdFusion restarts, when you reach the
>applicationTimeout, if you force a restart via code or via the
>CFADMIN/server monitor

To confirm my understanding, are you saying that on a very busy site, it's 
possible that OnApplicationStart might never run again once the app has 
started? (server admin and restarts aside.) Since the app is running fine for 
months and then all of a sudden switches configs, something else then must 
trigger a call to OnApplicationStart but with a screwy environment. (I'm going 
to add logging to track this down but I can't predict when the problem might 
happen again.)


>When you say you use cgi.server_name to determine which variables to use,
>are you being VERY explicity, as in the SERVER_NAME must match EXACTLY, or
>are you doing an if/else to say if its this then set as live else set as dev?

My code looks like this:

configName = "dev"
if CGI.SERVER_NAME contains "blah.com"
    configName = "production"

I can tell from a diagnostic page I have that configName's value ended up being 
"dev". Fixing the problem is as easy as forcing a call to OnApplicationStart by 
hitting a special URL. Which makes me wonder under what circumstances 
OnApplicationStart can be called without CGI being set properly. Strange.




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343359
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to