What is deadlock and how to avoid the deadlocks.

Answers were Sorted based on User's Feedback



What is deadlock and how to avoid the deadlocks...

Answer / moin

A deadlock occurs when there is a cyclic dependency between
two or more threads for some set of resources.

Is This Answer Correct ?    13 Yes 1 No

What is deadlock and how to avoid the deadlocks...

Answer / dba

P1 has lock on R1
P2 has lock on R2
P1 requests lock on R2
P2 Requests lock on R1

Where P & R are corresponding processes and resources.

Deadlock consists of two processes requesting locks on
resources thus, blocking each other.

You can avoid Deadlocks:
Access objects in the same order
Use lower isolation levels
Keep Transactions short and in one batch
Avoid user interactions in transaction
Use bound connections

Is This Answer Correct ?    7 Yes 1 No

What is deadlock and how to avoid the deadlocks...

Answer / raghu

Consider there are transcations going on 1 row, some one is
trying to update a column in that row while others are
trying to retrive data of same row,while update locks the
row for some period of time others cannot select it, hence
deadlock occurs.

To kill the process is solution. In sql server 2005 use sql
profiler to view the process, in that see the column named
transactions if its value is more than 1 right click and
kill the process.

Is This Answer Correct ?    4 Yes 4 No

Post New Answer

More SQL Server Interview Questions

Insert syudents details in table.Current system date &time insert into joining time.How do insert?( in sysdate only return current system date how do add time?)

0 Answers  


What is the tcp/ip port on which sql server runs?

0 Answers  


wat wil hapn if we give the both read and deny read permission to user?

0 Answers   IBM,


What are the different index configurations a table can have?

0 Answers  


Explain the different index configurations a table can have?

0 Answers  






How many types of the database links?

0 Answers   MCN Solutions,


How the data stores in a page?

1 Answers  


Hi all, I need query help for below senorio, could you please help me. TableName = City CITYID ContinuationID CITYNAME 1 1 SAN 1 2 DIEGO 2 1 SAN 2 2 FRANCISCO 3 1 CHICAGO 4 1 NEW 4 2 YORK 4 3 CITY Could you please help me to write a generalized SQL that returns results as given below in the Query result CITYID NAME1 NAME2 NAME3 NAME4 NAME5 1 SAN DIEGO 2 SAN FRANCISCO 3 CHICAGO 4 NEW YORK CITY

5 Answers   TCS,


How to create an index on a view?

0 Answers  


What is scan table/view and seek table/view when its occurs? : sql server database administration

0 Answers  


How do clustered indexes store data?

0 Answers  


What is the difference between char, varchar and nvarchar?

0 Answers  


Categories