cflock

"-->
 <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> 

Description

Ensures the integrity of shared data. Instantiates the following kinds of locks:

  • Exclusive. Enables single-thread access to the CFML constructs in its body. Can only be executed by one request at a time and no other requests can start executing when the request has an exclusive lock. ColdFusion issues exclusive locks on a first-come, first-served basis.

  • Read-only. Creates a read-only lock that does not enable data to be modified but enables multiple requests to access data concurrently.

Attributes

timeout (Required)

Maximum length of time to wait to obtain a lock.

scope (Optional)

Mutually exclusive with the name attribute. Options are Application, Server, or Session.

name (Optional)

Lock names are shared among applications and user sessions so that a lock can be used in different parts of an application. Only one request can execute within a given name.

throwOnTimeout (Optional)

Default: Yes

  • Yes. Exception is generated for the timeout.

  • No. Execution continues past this tag.

type (Optional)

Default: exclusive

  • read-only. Lets more than one request read shared data. Note that if performance is an issue, the read-only lock is faster than the exclusive lock.

  • exclusive. Lets one request read or write shared data.



Inside ColdFusion MX
Inside Coldfusion MX
ISBN: 0735713049
EAN: 2147483647
Year: 2005
Pages: 579

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net