What is meant by deadlock in database?

Transaction is unit of work done. So a database management system will have number of transactions. There may be situations when two or more transactions are put into wait state simultaneously .In this position each would be waiting for the other transaction to get released. Suppose we have two transactions one and two both executing simultaneously. In transaction numbered one we update student table and then update course table. We have transaction two in which we update course table and then update student table. We know that when a table is updated it is locked and prevented from access from other transactions from updating.
So in transaction one student table is updated it is locked and in transaction two course table is updated and it is locked. We have given already that both transactions gets executed simultaneously. So both student table and course table gets locked so each one waits for the other to get released. This is the concept of deadlock in DBMS.

Questions by GeekAdmin   answers by GeekAdmin

Showing Answers 1 - 13 of 13 Answers

Deadlock means Locking put on data when one transaction is being under operation on a record.

supposs you are inserting a record into the table that tabel is being put under lock.This does not mean that no one can see the record from the table but this mens no one can apply any DML to that table.Same time any changes made to that table will not be seen untill the record have been commited

Once the record is Commited the Deadlock is realaesed from that table.

  Was this answer useful?  Yes

deepak meena

  • Sep 6th, 2011
 

dead lock is defined as a situation arise during multiple transactions which put all the transactions on halting situation where the transactional programs seems dead means they stop their execution until the suitable technique never applied to solve this.

  Was this answer useful?  Yes

rohit

  • Apr 22nd, 2012
 

It is absolutely wrong.you can read data simultaneously but you cant write data ......you can write data one at a time only...

  Was this answer useful?  Yes

Chittaranjan Kotian

  • May 16th, 2012
 

Two Oracle Sessions attempting to obtain a lock on a rows that is being locked by each other. For example Session A has locked a row for update in a transaction. Session B is trying to obtain a lock on the same record in its own transaction.

Session A now completes is update but the transaction is not yet committed or rolled back and hence the lock is still maintained. Session A now tries to obtain a lock on a record that has been locked by Session B. So a situation occurs where both Session A & B are waiting on records locked by each other. Such a situation is called a DEADLOCK

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions