Behavior of cflock when the 'timeout' attribute is set to 0
When using the cflock tag, timeout is a required attribute that is used to specify the amount of time in seconds that ColdFusion should wait to obtain a lock on a segment of code. If access to this locked segment of code cannot be obtained within the time specified in the timeout attribute, either an error is thrown (if thethrowOnTimeout attribute is set to "Yes" or not present), or processing will continue without executing the code contained within the cflock block (ifthrowOnTimeout is set to "No").
If you set the timeout attribute to 0, and the"Timeout Requests after x" setting in the ColdFusion MX Administrator Settings page is enabled, the timeout period is determined by the Administrator setting. If the Administrator"Timeout Requests after x" setting is not enabled and you set thetimeout attribute to 0, ColdFusion can wait indefinitely to obtain the lock.
Additional Information
Related TechNotes:
- ColdFusion MX: Best practices for locking shared scope variables (TechNote 18235)
- ColdFusion (Versions 5 and prior): ColdFusion locking best practices (TechNote 17882)
- ColdFusion 4.5.x and 5: "Unable to acquire lock for single threaded sessions within timeout period" error occurs (TechNote 18103)
This content requires Flash
To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.
Download the free Flash Player now!
