Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started
by Ben Forta, Raymond Camden, Charlie Arehart
Using Exclusive Locks
As Table 19.5 shows, there are two types of locks: Exclusive and ReadOnly. Let’s start off simple, and talk about <cflock> tags of type="Exclusive". If you want, you can solve your race condition problems using only Exclusive locks.
Exclusive locks work like this. When your template gets to an opening <cflock> tag in your code, it requests the corresponding lock from the server. There is only one available lock for each scope (Application, Session, Request, or Server), which is why it’s called “exclusive.” Once this Exclusive lock has been bestowed upon your template, it stays there until the closing </cflock> tag in your code, at which point the lock is released and returned to the server. While your template has the lock ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access