I have some questions that relate to ColdFusion's processing and storage of
application-level variables declared in the Application.cfm file. Any help
is greatly appreciated.
It is my understanding that when ColdFusion receives a request for a
template, it first attempts to locate an Application.cfm file by scanning
the directory from the template's present location all the way to the
document root. ColdFusion server reads and processes the first
Application.cfm file it finds before processing the requested template.
Is this understanding correct?
If so,
1. Do variables scoped with the Application field type point to the same
memory space for a given application as defined by <CFAPPLICATION> in
Application.cfm? If not, how are variables scoped with the Application
field type different from variables that exist in other field types such as
CGI, Variables, Form, URL, etc.?
2. Does ColdFusion execute variable assignment statements in
Application.cfm on each request (e.g. <CFSET Application.var1 = "Test">)?
If not, why is Application.cfm processed on each request?
3. What does the IsDefined() function evaluate to determine if a variable
has been defined? Does the following expression
IsDefined("Application.var1") initiate a read on shared memory space? In
other words, does a lock need to be placed around this expression as in the
following example:
<CFLOCK SCOPE="Application" TIMEOUT="5" THROWONTIMEOUT="Yes"
TYPE="EXCLUSIVE">
<CFIF IsDefined("Application.var1")>
<CFSET Application.var1 = "Test">
</CFIF>
</CFLOCK>
4. What is the difference between using Application.cfm to store
application-level data and simply using <CFINCLUDE> to include another
template that contains variable initialization statements like the
statements below?
<CSCRIPT>
var1 = 12;
var2 = 13;
</CFSCRIPT>
TIA,
Jason Southern
==========================
Jason Southern
[EMAIL PROTECTED]
703.796.9141
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-linux%40houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_linux or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.