Name

cflock

Synopsis

<cflock> 
CFML and HTML to be locked 
</cflock>

Provides single-threaded access to code within the <cflock>...</cflock> tags. cflock should be used when reading and writing persistent variables (application, session, and server variables) within your ColdFusion applications, to eliminate the potential for unintentionally overwriting or sharing data. cflock can also lock access to non thread-safe CFX tags and to file-manipulation operations that can result in multiple threads attempting to access an already open file.

In ColdFusion 5.0, additional locking options are available via the ColdFusion Administrator under the Server section. They are, however, no longer available in ColdFusion MX. These options allow you to determine how ColdFusion treats locking for all applications across the server. Performance can be significantly affected depending on the options you choose. The following choices are available:

Single-Threaded Sessions (Session Scope)

ColdFusion single-threads access to each session by session ID for the duration of a request. While this eliminates all potential variable corruption and conflict within a session, it can have a dramatic effect on performance.

No Automatic Checking or Locking (Session, Application, and Server Scope)

ColdFusion performs no automatic checking or locking of persistent variables. All variables must be locked explicitly using the cflock tag. No exceptions are thrown when nonlocked variables are encountered. This method is ...

Get Programming ColdFusion MX, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.