Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
DrAngus #1
Auto-run a template after CFMX restart
We have application-scoped variables that control user access. If we restrict
access to certain application modules and the server goes down (scheduled
reboots in the middle of the night, emergencies, etc.), after restart the
application-scoped variables are wiped away, causing traffic on modules whose
restrictions got blown away by the reboot. I'd like to run a template that
initializes the application variables once, right after the CFMX server
reboots. How might this be done? Many thanks. Tim
DrAngus Guest
-
Setting Auto Restart Service for CFMX 7 instance
I have already set up multiple CFMX 7 instances on a Windows 2003 server (using the build-in JRUN server). Upon reboot I discovered that severaI... -
Run Template on Restart?
I have a template I use to initialize some application variables whenever I restart the server. Is there a way to automatically execute the template... -
Java Class Reload Without Restart CFMX
How can I make my updated java classes work without restarting CFMX. This Java Classes are not a CFX tags. It is just a normal class. -
How do I restart CFMX server?
I have the Coldfusion running locally on my computer to test my coldfusion pages. But when I open the pages in my browser, it says the server cannot... -
DW4 froze on template update, will not restart
While trying to save an updated template, I got the error message that the template contained an invalid path or file name. I clicked on "OK"... -
cf_menace #2
Re: Auto-run a template after CFMX restart
Just put a check in your Application.cfm file for the existence of one of those
variables. This is part of what I've got to initialize a set of application
variables to their default values (read from an XML file) when the application
starts.
Kudos to WebTricks.com for some of this code.
HTH
<cflock scope="application" timeout="10" type="exclusive">
<cfparam name="application.initialized" default="false">
<!--- Create a Request variable to hold the value so you don't need a read
lock to get it in the next block of code. --->
<cfset request.initialized = application.initialized>
</cflock>
<cfif NOT request.initialized OR IsDefined("url.init")>
<!--- Get the default application variables and values from the configuration
XML file. --->
<cfset configApp = CreateObject("component",
"com.riaservicesinc.common.xmlTools").loadXmlConfi g(ExpandPath('WEB-INF/riasConf
ig/xml') & "/riaservicesAppConfig.xml")>
<!--- Create an exclusive Application scope lock and set the values. --->
<cflock scope="application" timeout="10" type="exclusive">
<cfset application.config = Duplicate(configApp.config)>
<cfset application.initialized = true>
</cflock>
</cfif>
cf_menace Guest
-
DrAngus #3
Re: Auto-run a template after CFMX restart
Thanks for the response. I had previously considered setting such an
application-scoped flag, but since every request for a template within the
application would require checking the flag's status, this might mean tens of
thousands of such checkings per day. For efficiency's sake I was hoping for a
one-time-only solution--the one time being when the CFMX service was restarted.
DrAngus Guest



Reply With Quote

