Nested Locks and Deadlocks

It’s usually okay to nest named locks within one another, as long as the name for each lock block is different. However, if they aren’t nested in the same order in all parts of your code, it’s possible that your application will encounter deadlocks while it runs. Deadlocks are situations where it’s impossible for two page requests to move forward because they are each requesting a lock that the other already has. Consider a template with an Exclusive lock named LockA, with another <cflock> named LockB nested within it. Now consider another template, which nests LockA within LockB. If both templates execute at the same time, the first page request might be granted an Exclusive lock for LockA, and the second could get ...

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.