There are three general techniques for handling deadlock: timeouts, deadlock prevention,
and deadlock detection and recovery. With timeouts, the transaction that has requested a
lock waits for at most a specified period of time. Using deadlock prevention , the DBMS
looks ahead to determine if a transaction would cause deadlock, and never allows dead-lock to occur. Using deadlock detection and recovery, the DBMS allows deadlock to
occur but recognizes occurrences of deadlock and breaks them. Since it is more difficult
to prevent deadlock than to use timeouts or testing for deadlock and breaking it when it
occurs, systems generally avoid the deadlock prevention method.