Runs when an application times out or the server is shutting down.
<cffunction name="onApplicationEnd" returnType="void"> <cfargument name="ApplicationScope" required=true/> ... </cffunction>
ColdFusion passes the following parameters to the method:
The application scope.
method does not return a value; do not use the
Use this method for any clean-up activities that your application requires when it shuts down, such as saving data in memory to a database, or to log the application end to a file. You cannot use this method to display data on a user page, because it is not associated with a request. The application ends, even if this method throws an exception.
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.
Use the ApplicationScope parameter to access the application scope; you cannot reference the scope directly; for example, use Arguments.ApplicationScope.myVariable, not Application.myVariable. This method can access the Server scope directly, but it does not have access to Session or Request scopes.
onSessionEndmethod is not called when an application ends. For more information, see
<cffunction name="onApplicationEnd"> <cfargument name="ApplicationScope" required=true/> <cflog file="#This.Name#" type="Information" text="Application #Arguments.ApplicationScope.applicationname# Ended" > </cffunction>