Sunday, July 12, 2009

More About Deadlock and Timeout

-911:
=====

-911 THE CURRENT UNIT OF WORK HAS BEEN ROLLED BACK DUE TO DEADLOCK OR
TIMEOUT. REASON reason-code, TYPE OF RESOURCE resource-type, AND
RESOURCE NAME resource-name

Explanation: The current unit of work was the victim in a deadlock, or
experienced a timeout, and had to be rolled back.

Note: The changes associated with the unit of work must be entered again.

SQLERRD(3) also contains the reason-code which indicates whether a
deadlock or timeout occurred. The most common reason codes are:

- 00C90088 - deadlock
- 00C9008E - timeout

System Action: The statement cannot be executed. The application is
rolled back to the previous COMMIT.

Programmer Response: A long-running application, or an application that
is likely to encounter a deadlock, should (if possible) issue frequent
COMMIT commands. This can lessen the possibility of a deadlock occurring.
See message DSNT376I for other possible ways to avoid future deadlocks or
timeouts. On receipt of the SQLCODE -911, the application should, in
general, terminate.

For more information about how IMS, CICS, and TSO handle deadlocks, see
Section 5 of Application Programming and SQL Guide.
00C9008E (Timeout Reason Code):
===============================

Explanation: A lock request for the resource identified by NAME could not
be granted, and the request waited for a period longer than the maximum
specified by the installation.

This reason code is issued by the following CSECT: DSNILMCL

System Action: The data manager function that detected this condition
returns 'resource not available' to its invoker.

Message DSNT378I might also be issued.
00C90088 (Deadlock Reason Code):
================================

Explanation: The resource identified by NAME in message DSNT501I is
involved in a deadlock condition.

This reason code is issued by the following CSECT: DSNILMCL

System Action: The requested operation is not performed.

User Response: Rerun the application.

System Programmer Response: If the deadlock condition becomes chronic,
examine the mix of applications running to determine why the deadlock is
occurring.

If statistics trace class 3 is active, IFCID 172 contains diagnostic
information. For a discussion of the effects of locking, see Section 5
(Volume 2) of Administration Guide . If you suspect and error in DB2,
refer to Section 3 of Diagnosis Guide and Reference for information on
identifying and reporting the problem.

No comments:

Post a Comment