How does a deadlock occur?
A deadlock situation occurs if a database transaction is blocked when it requests a database lock but it already has another lock. This other lock, in turn, (either directly or indirectly) blocks the database transaction that has the requested lock. This leads to a cyclical wait situation. Only two database transactions are involved in the vast majority of deadlocks. The example works on the assumption that the database transactions are executed by SAP work processes. In work processes 1 and 2, two update operations should be executed in each case, more specifically on rows A and B, but with the sequence swapped around (so statement 1 and 4 on row A and statement 2 and 3 on row B). First, a database row from each transaction (first and second update) is locked, since you need to execute a changing operation. However, since no commit or rollback is executed, the locks remain. You are already unable to execute statement 3, since there is already a blocking lock on database row B. The dea