1. The deadlock in a set of transaction can be determined by
Answers
Deadlock is a state of a database system having two or more transactions, when each transaction is waiting for a data item that is being locked by some other transaction. A deadlock can be indicated by a cycle in the wait-for-graph.
Answer:
Deadlock occurs when a set of processes are in a wait state because each process is waiting for a resource that is held by some other waiting process. Therefore, all deadlocks involve conflicting resource needs by two or more processes.
Explanation:
Deadlock is a state of a database system having two or more transactions when each transaction is waiting for a data item that is being locked by some other transaction. A deadlock can be indicated by a cycle in the wait-for-graph
In a database, a deadlock is a situation in which two or more transactions are waiting for one another to give up locks.
Avoiding deadlocks:
- Ensure the database design is properly normalized.
- Develop applications to access server objects in the same order each time.
- Do not allow any user input during transactions.
- Avoid cursors.
- Keep transactions as short as possible.