Chapter 1: ColdFusion Tags
125
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.
The following deadlock scenario could take place if you tried to nest a write lock after a
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.
Deadlock Scenario with Two Users
User 1
User 2
Locks the session scope .
Locks the application scope.
Deadlock: Tries to lock application scope,
but application scope already is locked by
User 2.
Deadlock: Tries to lock the session scope,
but session scope already is locked by User
1.
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.
Содержание COLDFUSION 4.5-CFML LANGUAGE
Страница 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Страница 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Страница 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Страница 296: ...272 CFMLLanguageReference INPUT TYPE text NAME number2 BR INPUT TYPE submit NAME submit VALUE Add FORM BODY HTML...
Страница 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Страница 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Страница 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Страница 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Страница 557: ...Chapter 2 ColdFusion Functions 533 P CFOUTPUT Value i is employee keysToStruct i CFOUTPUT P CFLOOP CFIF BODY HTML...
Страница 584: ...560 CFMLLanguageReference...
Страница 594: ...570 CFMLLanguageReference...