Locking

You use the Locking page of the ColdFusion Administrator to configure automatic mechanisms to protect shared data from incorrect access and corruption. In addition, the cflock tag provides granular control of simultaneous access to shared data scope variables, including server, application, and session scopes. For more information on the cflock tag, see Developing ColdFusion Applications.

Single threaded sessions

Single threading means that requests from a session occur sequentially. Each request from the same session waits for previous requests to finish before proceeding, thereby preventing multiple requests from simultaneously accessing shared data. This option is disabled at installation.

Because session requests occur sequentially, single threaded sessions are useful if you do not want to lock session scope variables with the cflock tag. At the same time, if you use frames in your ColdFusion application, each pane loads consecutively. When single threaded sessions is enabled in the Administrator, you do not need to the use the cflock tag for session scope variables.

In addition, single threaded sessions can prove valuable to debugging a ColdFusion application. If the application error goes away when single threaded sessions is enabled. you likely have an unlocked session scope variable.

Variable scope locking settings

Specify variable scope lock settings by clicking the appropriate option. Each scope (server, application and session) has three settings, as described in the following table:
Option
Description
No automatic checking or locking
No automatic checking or locking occurs. The developer must protect variables with the cflock tag. If variables are not locked, data corruption may result, and server instability may occur.
Full checking
ColdFusion Server checks shared variable scope access automatically to ensure that it is properly locked. If a data read or write occurs outside the scope of a cflock tag, an error displays.
Automatic read locking
ColdFusion Server checks whether shared variable scope writes are locked and automatically locks shared variable scope reads. If ColdFusion Server encounters shared variable scope writes that are not locked, an error displays.


Note

Apply full checking and automatic read locking only to applications that use the scope attribute, not the name attribute, of the cflock tag to specify locks If you specify the name attribute with full checking enabled, ColdFusion Server responds with an error on a variable accessed within the scope of a cflock tag scope. If you specify the name attribute with automatic read locking enabled, ColdFusion Server responds with errors for writes, and possibly a deadlock for reads.




Banner.Novgorod.Ru