The db_deadlock utility traverses the database lock structures and aborts a transaction each time it detects a deadlock. This utility should be run as a background daemon whenever multiple threads or processes are using locking. By default, a random transaction involved in the deadlock is aborted.