Skip to main content
July 22, 2009
Question

Force application to end using code

  • July 22, 2009
  • 1 reply
  • 970 views

I am working on specific functionality in the application.cfc and need to see what is happening when an application starts and ends (onApplicationStart and onApplicationEnd methods). Outside of stopping and starting ColdFusion itself, and without playing with the "applicationtimeout" setting, is there any way using code to force an application to end?

This topic has been closed for replies.

1 reply

Inspiring
July 22, 2009

Have you tried something like:

<cfinvoke method="onApplicationEnd">
    <cfinvokeargument name="ApplicationScope" value="#application#" />
</cfinvoke>

I haven't tried this myself by the CF documententation implies you can call the onApplicationEnd method in your code.
"If you call this method explicitly, ColdFusion does not end the application; it does execute the method code, but does not lock the Application scope while the method executes."
http://livedocs.adobe.com/coldfusion/8/htmldocs/AppEvents_04.html#1188612

July 22, 2009

That's what I'm doing now - I invoke the onApplicationEnd, passing the application scope and then the last line of that method, I invoke the onApplicationStart method. It works, but I would like to test the actually ending and starting. Unfortunately, nobody I've talked to has a solution. Perhaps it's a ColdFusion security issue - malicious code can't close the application?

Thanks for the reply, it's nice to know I'm not totally crazy on my approach!