Using ReadOnly Locks
Okay, you’ve seen how Exclusive locks work. They simply make sure that no two blocks of the same scope are allowed to execute at once. If two requests need the same lock at the same time, the first one blocks the second one. But in some situations this can be overkill, and lead to more waiting around than is really necessary.
ColdFusion also provides ReadOnly locks, which are less extreme. ReadOnly locks don’t block each other. They only get blocked by Exclusive locks. In plain English, a ReadOnly lock means, “If the variables in this block are being changed somewhere else, wait until the changes are finished before running this block.” Use a ReadOnly lock if you have some code that definitely needs to read the correct, ...
Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started 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.