September 6th, 2012, 12:27 PM
Application scope losing variables
My app is setup to email me the details of any runtime errors when they occur. Additionally, on every request, my controller looks for an updated config.xml (by file modified date) to refresh certain application variables should the data in that xml file change. All requests to my application go through the controller.
The problem I'm seeing is some of my scheduled tasks are failing. The error being reported is that the expected application scope variables do not exist -- which should not be possible because the controller initializes them if they don't exist before processing the request. My application is also set to send me an email on the first request it receives after the server has been started (allowing me to track unexpected reboots and server restarts). I am not receiving these emails so I can conclude that the server is not restarting unexpectedly.
Any ideas why my application variables would be getting cleared without the server restarting? I have no code in place to clear these variables -- only code to set them.
September 6th, 2012, 12:52 PM
Application variables also have a time out, either set in the Application.cfc/.cfm, or whatever is set in the CF administrator.
September 6th, 2012, 12:57 PM
Yeah, I've considered the timeout. But I have it set to 7 days in the console and 1 day in Application.cfm. I see these errors pop up a couple of times per day.
Additionally, this only started happening after I migrated my system to a Windows Server 2008 machine.
September 6th, 2012, 03:28 PM
Not sure then. Which version of CF are you on? My guess is that it must be something in either your initialization logic, the order things are happening, a race condition, or a server config issue.
Comments on this post
September 6th, 2012, 05:03 PM
I'm actually using Open BlueDragon, so it could very well be a bug in the build I'm using. I posted it to their google group, so I was mostly hoping someone here might suggest something simple that I'm overlooking. Thanks for your input.