RPG (IBM i / AS/400) · DB2 SQLCODE

SQLCODE -913 - Deadlock or Timeout

What does SQLCODE -913 - Deadlock or Timeout mean in RPG (IBM i / AS/400)?

The SQL statement was waiting on a lock held by another job, and either a deadlock was detected or the lock wait time expired before the lock could be obtained - and unlike some lock errors, no automatic rollback happens for this one.

SQLCODE -913 - Deadlock or TimeoutDB2 for i · SQLRPGLE

Condition

The SQL statement was waiting on a lock held by another job, and either a deadlock was detected or the lock wait time expired before the lock could be obtained - and unlike some lock errors, no automatic rollback happens for this one.

Fix

Catch SQLCODE -913 and decide whether to retry the statement after a short delay, review the transaction's lock scope and commit frequency if this happens often under load, and check the job's lock wait time attribute if timeouts are too aggressive.

Related db2 sqlcode