User Guide
270 Chapter 2: ColdFusion Tags
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 ColdFusion MX Developer’s Guide