In DB2 a Deadlock or Timeout situation produces a -911 sql error code.
-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
The current unit of work was the victim in a deadlock, or experienced a timeout, and had to be rolled back. The reason code indicated whether a deadlock or timeout occurred.
A deadlock situation arises when two (or more) units of work are waiting to acquire a lock on a shared resource, and none of them can proceed because a second unit of work also has a lock on some other resource that is required by the first session.
Scenario: Unit of work #1 holds resource A, while trying to access resource B; at the same time Unit of work #2 holds resource B while trying to access resource A.
Usually DB2 resolves situations like this automatically by terminating one of the processes and rolling back all the changes it may have made.