MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference page 149

Cfml language reference
Table of Contents

Advertisement

Chapter 1: ColdFusion Tags
Thus, all requests to the protected section of the page are blocked until there is a
timeout. The following tables show two scenarios that cause deadlocks.
Deadlock Scenario with Two Users
User 1
Locks the session scope .
Deadlock: Tries to lock application scope,
but application scope already is locked by
User 2.
The following deadlock scenario could take place if you tried to nest a write lock after a
Deadlock Scenario With One User
User 1
Locks the session scope with a read lock.
Attempts to lock the session scope with an
exclusive lock.
Deadlock: Attempts to lock the session
scope with an exclusive lock, but cannot
because the scope is already locked for
reading.
read lock, as in the following code:
<CFLOCK TIMEOUT="60" SCOPE="SESSION" TYPE="ReadOnly">
...............
<CFLOCK TIMEOUT="60" SCOPE="SESSION" TYPE="Exclusive">
.........
</CFLOCK>
</CFLOCK>
Once a deadlock occurs neither of the users can do anything to break the deadlock,
because the execution of their requests is blocked until the deadlock can be resolved
by a lock timeout.
In order to avoid a deadlock, you and all who need to nest locks should do so in a well-
specified order and name the locks consistently. In particular, if you need to lock
access to the server, application, and session scopes, you must do so in the following
order.
1.
Lock the session scope. In the CFLOCK tag, indicate the scope by
specifying "SESSION" as the value of the SCOPE attribute.
User 2
Locks the application scope.
Deadlock: Tries to lock the session scope,
but session scope already is locked by User
1.
125

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 4.5

Table of Contents