Observing deadlocks and similar issues
Deadlocks are an important issue and can happen in every database. Basically, a deadlock will happen if two transactions have to wait on each other.
In this section, you will see how this can happen. Let’s suppose we have a table containing two rows:
CREATE TABLE t_deadlock (id int); INSERT INTO t_deadlock VALUES (1), (2);
The following example shows what can happen:
Transaction 1 |
Transaction 2 |
|
|
|
|
|
|
Waiting on transaction 2 |
|