126
CFML Language Reference
2.
Lock the application scope. In the CFLOCK tag, indicate scope by
specifying "APPLICATION" as the value of the SCOPE attribute.
3.
Lock the server scope. In the CFLOCK tag, indicate the scope by specifying
"SERVER" as the value of the SCOPE attribute.
4.
Unlock the server scope.
5.
Unlock the application scope.
6.
Unlock the session scope.
Note
You can take out any pair of lock/unlock steps if you do not need to lock a
particular scope. For example, you can take out Steps 3 and 4 if you do
not need to lock the server scope. Similar rules apply for named locks.
For complete usage information on CFLOCK, see Developing Web Applications with
ColdFusion.
Example
<!-------------------------------------------------------------
This example shows how CFLOCK can be used to guarantee the
consistency of data updates to variables in the Application,
Server, and Session scopes.
You should copy the following code into an Application.cfm
file in the snippets directory.
--------------------------------------------------------------->
<HTML>
<HEAD>
<TITLE>Define Session and Application Variables</TITLE>
</HEAD>
<BASEFONT FACE="Arial, Helvetica" SIZE=2>
<BODY bgcolor="#FFFFD5">
<H3>CFAPPLICATION Example</H3>
<P>CFAPPLICATION defines scoping for a ColdFusion application and
enables or disables the storing of application and/or session
variables. This tag is placed in a special file called
Application.cfm that is run before any other CF template in a
directory where the Application.cfm file appears.</P>
<CFAPPLICATION NAME="ETurtle" SESSIONTIMEOUT=#CreateTimeSpan(0, 0,
0, 60)# SESSIONMANAGEMENT="yes">
<!----------------------------------------------------------------------
Initialize the session and application variables that will be
used by E-Turtleneck. Use the session scope for the session
variables.
----------------------------------------------------------------------->
<CFLOCK SCOPE="Session" TIMEOUT="30" TYPE="Exclusive">
<CFIF NOT IsDefined("session.size")>
<CFSET session.size = "">
</CFIF>
Содержание COLDFUSION 4.5-CFML LANGUAGE
Страница 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Страница 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Страница 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Страница 296: ...272 CFMLLanguageReference INPUT TYPE text NAME number2 BR INPUT TYPE submit NAME submit VALUE Add FORM BODY HTML...
Страница 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Страница 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Страница 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Страница 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Страница 557: ...Chapter 2 ColdFusion Functions 533 P CFOUTPUT Value i is employee keysToStruct i CFOUTPUT P CFLOOP CFIF BODY HTML...
Страница 584: ...560 CFMLLanguageReference...
Страница 594: ...570 CFMLLanguageReference...