cflock
221
cflock
Description
Ensures the integrity of shared data. Instantiates the following kinds of locks:
•
Exclusive
allows single-thread access to the CFML constructs in its body. The tag body can
be executed by one request at a time. No other requests can start executing code within the tag
while a request has an exclusive lock. ColdFusion issues exclusive locks on a first-come,
first-served basis.
•
Read-only
allows multiple requests to access CFML constructs within the tag body
concurrently. Use a read-only lock only when shared data is read and not modified. If another
request has an exclusive lock on shared data, the new request waits for the exclusive lock to be
released.
Category
Application framework tags
Syntax
<cflock
timeout = "timeout in seconds "
scope = "Application" or "Server" or "Session"
name = "lockname"
throwOnTimeout = "Yes" or "No"
type = "readOnly" or "exclusive ">
<!--- CFML to be synchronized --->
</cflock>
See also
cfapplication
,
cfassociate
,
cfmodule
,
Chapter 15, “Using Persistent Data and Locking,”
in
Developing ColdFusion MX Applications
Attributes
Attribute
Req/Opt Default
Description
timeout
Required
Maximum length of time, in seconds, to wait to obtain a
lock. If lock is obtained, tag execution continues.
Otherwise, behavior depends on
throwOnTimeout
attribute
value.
scope
Optional
Lock scope. Mutually exclusive with the
name
attribute.
Lock name. Only one request in the specified scope can
execute the code within this tag (or within any other
cflock
tag with the same lock scope scope) at a time.
•
Application
•
Server
•
Session
name
Optional
Lock name. Mutually exclusive with the
scope
attribute.
Only one request can execute the code within a
cflock
tag
with a given name at a time. Cannot be an empty string.
Permits synchronizing access to resources from different
parts of an application. Lock names are global to a
ColdFusion server. They are shared among applications
and user sessions, but not clustered servers.
Summary of Contents for COLDFUSION MX 61-CFML
Page 1: ...CFML Reference...
Page 16: ...16 Contents...
Page 32: ...32 Chapter 1 Reserved Words and Variables...
Page 160: ...160 Chapter 2 ColdFusion Tags html...
Page 245: ...cfmail 245 p input type Submit name form...
Page 299: ...cfreturn 299 cffunction cfcomponent...
Page 354: ...354 Chapter 2 ColdFusion Tags cfoutput cfcatch cftry...
Page 357: ...cfupdate 357 cftable cfif body html...
Page 362: ...362 Chapter 2 ColdFusion Tags cfloop MyDoc cfxml cfdump var MyDoc...
Page 397: ...ASin 397 br input type Text name sinNum size 25 p input type Submit name input type RESET form...
Page 486: ...486 Chapter 3 ColdFusion Functions input type Submit NAME form...
Page 492: ...492 Chapter 3 ColdFusion Functions b http_content x content b cfoutput...
Page 504: ...504 Chapter 3 ColdFusion Functions tr table form...
Page 519: ...IIf 519 cfoutput b...
Page 534: ...534 Chapter 3 ColdFusion Functions input type Submit name form...
Page 542: ...542 Chapter 3 ColdFusion Functions cfif cfif...
Page 547: ...IsStruct 547 cfcase cfswitch...
Page 550: ...550 Chapter 3 ColdFusion Functions IsWDDX returns IsWDDX packet br cfoutput...
Page 559: ...Left 559 option value 9 9 select input type Submit name Remove characters form...
Page 620: ...620 Chapter 3 ColdFusion Functions cfoutput cfloop...
Page 681: ...SetVariable 681 p Your variable varName p The value of varName is varNameValue cfoutput cfif...
Page 724: ...724 Chapter 3 ColdFusion Functions cfelse h3 Conversion error h3 cfif...
Page 743: ...XmlNew 743 cfscript cfdump var MyDoc...
Page 786: ...786 Chapter 5 ColdFusion Java CFX Reference...
Page 798: ...798 Chapter 6 WDDX JavaScript Objects...
Page 806: ...806 Chapter 7 ColdFusion ActionScript Functions...