Chapter 1: ColdFusion Tags
123
THROWONTIMEOUT
Optional. Yes or No. Specifies how timeout conditions should be handled. If the
value is Yes an exception will be generated to provide notification of the timeout. If
the value is No execution continues past the </CFLOCK> tag. Default is Yes.
TYPE
Optional. ReadOnly or Exclusive. Specifies the type of lock: read-only or exclusive.
Default is Exclusive. A read-only lock allows more than one request to read shared
data. An exclusive lock allows only one request to read or write to shared data. See
the following Note.
Note
Limit the scope of code that updates shared data. Exclusive locks are
required to ensure the integrity of these updates, but they have a
significant impact on performance. Read-only locks are faster. If you
have a performance-sensitive application, you should substitute read-
only locks for exclusive locks wherever it is possible, for example, when
reading shared data.
Usage
ColdFusion Server is a multi-threaded web application server that can process
multiple page requests at any given time. Use CFLOCK to guarantee that multiple
concurrently executing requests do not manipulate shared data structures, files, or
CFXs in an inconsistent manner. Note the following:
•
Using CFLOCK around CFML constructs that modify shared data ensures that
the modifications occur one after the other and not all at the same time.
•
Using CFLOCK around file manipulation constructs can guarantee that file
updates do not fail due to files being open for writing by other applications or
ColdFusion tags.
•
Using CFLOCK around CFX invocations can guarantee that CFXs that are not
implemented in a thread-safe manner can be safely invoked by ColdFusion.
This usually only applies to CFXs developed in C++ using the CFAPI. Any C++
CFX that maintains and manipulates shared (global) data structures will have to
be made thread-safe to safely work with ColdFusion. However, writing thread-
safe C++ CFXs requires advanced knowledge. A CFML custom tag wrapper can
be used around the CFX to make its invocation thread-safe.
Scope
Whenever you display, set, or update variables, in one of the shared scopes, use the
SCOPE attribute to identify the scope as Server, Application or Session.
Within the ColdFusion Administrator, the Locking page, under the Server section,
allows you to set different characteristics of the locking schema according to scope.The
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...