I have some code in my onApplicationStart that loads in some configurations, creates objects, etc. In order to minimize the amount of time that is spent with the application scope locked I am putting the new configs/objects into temporary variables and then just locking the application at the end of the function to put the data in place.
...
<cflock scope="application" type="exclusive" timeout="20">
<cfloop list="#structKeyList(tempApplication)#" index="i">
<cfset application[i] = tempApplication[i] />
</cfloop>
</cflock>
...
The problem that I am having is that the onSessionStart is firing before the onApplicationStart finishes. This causes the onSessionStart to fail because the application hasn't finished and it references the application.
How have others solved this issue? I would like to avoid having to lock the application for the entire onApplicationStart but I'm not sure how else to get the onSessionStart to wait until it is complete.
--
Randy Merrill