Just some thoughts...
I think it will work - but using "CFC" as a key name in the application
scope just feels wrong... almost creepy. ;^)
Are you on unix? If so "Application.cfm" is case sensitive.
How are you setting your app name?
For what it's worth you could check your startup state a lot easier:
<cfif NOT IsDefined("Application.Initialized")>
<cflock name="AppInit" timeout="20" throwontimeout="Yes">
<cfif NOT IsDefined("Application.Initialized")>
<!--- Do initializations --->
<cfset application.FOODdsn ="food1">
<cfset application.cfc = "cfc">
<!--- and so on --->
<cfset Application.Initialized = True />
</cfif>
</cflock>
</cfif>
To explain:
1) You do not have to lock the application for reads after CF 6. ALL reads
are automatically thread safe.
2) You do the check first, then lock with a NAME lock to prevent multiple
templates from running the init code. If multiple template start at once
the first will run the init, the rest will sit at the lock point.
You could do a scope lock here - but why bother when all you want to do is
lock this one block of code?
3) You do the IsDefined check AGAIN just in case there are multiple
templates sitting at the lock. Once the lock is released you want those
other templates to just skip the init block and continue.
Jim Davis
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:204623
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54