Hello
I perform some cleanup operations in the onApplicationEnd method of my
application.cfc and have noticed some unexpected behaviour that I hope someone
might be able to explain.
Consider the following application.cfc snippet:
========================================================
<cfcomponent output="false">
<cffunction name="onApplicationStart" returnType="boolean" output="true">
<cfset application.cacheObject=0>
<cfset application.classDirectory="/DEV/GT/classes/">
<cfscript>
stArgs = structNew();
stArgs.class="myContext";
</cfscript>
<cfinvoke component="ObjectChef" method="createObj"
returnvariable="loader" argumentCollection="#stArgs#"/>
<cfset res = loader.startup()>
<cfmail to="him" from="me" subject="App Started">#res#</cfmail>
<cfreturn true>
</cffunction>
<cffunction name="onApplicationEnd" returnType="void" output="false">
<cfargument name="applicationScope" required="true">
<cfscript>
stArgs = structNew();
stArgs.class="myContext";
</cfscript>
<cfinvoke component="ObjectChef" method="createObj"
returnvariable="loader" argumentCollection="#stArgs#"/>
<cfset res = loader.shutdown()>
<cfmail to="him" from="me" subject="app end">#res#</cfmail>
</cffunction>
</cfcomponent>
========================================================
When I restart CFMX and request a page, the onApplicationStart fires and
successfully sends out an email, but onApplicationEnd consistently fails to
send out the confirmation email. If I move the code to a simple .cfm file it is
processed correctly, so it must be related to onApplicationEnd.
Are there limitations on the types of requests the onApplicationEnd function
can make when called? For example, is there any restriction on its ability to
call a component (ObjectChef)?
Thanks, David
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:250425
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4