What is deadlock and how to avoid the deadlocks.
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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?)
What is the tcp/ip port on which sql server runs?
wat wil hapn if we give the both read and deny read permission to user?
What are the different index configurations a table can have?
Explain the different index configurations a table can have?
How many types of the database links?
How the data stores in a page?
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
How to create an index on a view?
What is scan table/view and seek table/view when its occurs? : sql server database administration
How do clustered indexes store data?
What is the difference between char, varchar and nvarchar?