What it means
Like -911, this means your work lost a deadlock or waited too long for a lock. The difference is that Db2 has not rolled anything back: only the current statement failed. If it was a cursor FETCH, the cursor has been closed.
The program must now decide: roll back to the last commit point (the usual choice) or commit what it has done. The reason code (also in SQLERRD(3)) is usually 00C90088 for deadlock or 00C9008E for timeout.
Typical causes
- The same lock contention that causes -911, in a case where Db2 leaves the rollback decision to the application.
- Batch and online work updating the same data at the same time.
- Infrequent commits that hold locks for a long time.
How to fix it
- Read the reason code, resource type and resource name in the message.
- Issue ROLLBACK (or COMMIT if that is correct for your logic) before doing anything else, then normally end the program.
- Search SYSLOG around the failure for the related deadlock or timeout messages (for example DSNT376I) to see who held the lock.
- Reduce contention by committing more often and accessing data in a consistent order.
Example
Illustrative only; names and values are invented.
DSNT408I SQLCODE = -913, ERROR: UNSUCCESSFUL EXECUTION CAUSED BY DEADLOCK OR TIMEOUT.
REASON CODE 00C90088, TYPE OF RESOURCE ..., AND RESOURCE NAME ...