MainframeKit

-911

SQLSTATE 40001NEGATIVE SQLCODE

The unit of work was rolled back because it was chosen as the victim of a deadlock or it waited too long for a lock (timeout).

MOST LIKELY

Long-running batch jobs that do not commit often enough and hold many locks.

FIRST CHECK

Read the reason code: 00C90088 is a deadlock, 00C9008E is a timeout.

TRY IT ▸

MainframeKit assistant

What it means

Two or more units of work were waiting for each other's locks (deadlock), or your work waited for a lock longer than the allowed time (timeout). Db2 rolled your unit of work back to the last COMMIT, so every change since then is gone and must be redone.

The reason code tells you which it was: 00C90088 means deadlock and 00C9008E means timeout. The reason code is also placed in SQLERRD(3), and the message names the resource type and resource name that were involved.

Typical causes

  • Long-running batch jobs that do not commit often enough and hold many locks.
  • Two programs updating the same rows or pages in a different order.
  • Online transactions competing with batch work on the same tables.
  • Utilities or other jobs holding locks on the same table space.
  • A lock wait time (timeout value) that is too short for the workload.

How to fix it

  1. Read the reason code: 00C90088 is a deadlock, 00C9008E is a timeout.
  2. Use the resource type and name in the message to find the table space, page or row involved.
  3. Search SYSLOG around the failure time for the related deadlock or timeout messages (for example DSNT376I) that name the other unit of work.
  4. Commit more often in batch, and access tables and rows in a consistent order.
  5. Rerun from the last commit point; the program normally ends after -911 rather than continuing.

Example

Illustrative only; names and values are invented.

DSNT408I SQLCODE = -911, ERROR: THE CURRENT UNIT OF WORK HAS BEEN ROLLED BACK
         DUE TO DEADLOCK OR TIMEOUT. REASON 00C9008E, TYPE OF RESOURCE ...,
         AND RESOURCE NAME MYDB.MYTS...