Deadlock occurs when two transactions are each waiting on a resource that the other
transaction holds. Deadlock can be prevented by requiring transactions to acquire all
locks at the same time; once it occurs, the only way to cure it is to abort one of the
transactions and back out of partially completed work.