Click here to Skip to main content
16,005,222 members
Home / Discussions / Database
   

Database

 
QuestionSQL 2000 Reporting Services - HTTP Error 403 Pin
Kevin McFarlane22-May-06 3:16
Kevin McFarlane22-May-06 3:16 
AnswerRe: SQL 2000 Reporting Services - HTTP Error 403 Pin
Paul Conrad22-May-06 6:13
professionalPaul Conrad22-May-06 6:13 
GeneralRe: SQL 2000 Reporting Services - HTTP Error 403 Pin
Kevin McFarlane22-May-06 23:31
Kevin McFarlane22-May-06 23:31 
AnswerRe: SQL 2000 Reporting Services - HTTP Error 403 Pin
Kevin McFarlane23-May-06 5:48
Kevin McFarlane23-May-06 5:48 
QuestionSelect QUERY from a collection Pin
NICE TO MEET22-May-06 3:04
NICE TO MEET22-May-06 3:04 
AnswerRe: Select QUERY from a collection Pin
Paul Brower22-May-06 10:11
Paul Brower22-May-06 10:11 
QuestionDeadlock in the MS Sql server 2000 Pin
srinivasaRaoS22-May-06 0:51
srinivasaRaoS22-May-06 0:51 
AnswerRe: Deadlock in the MS Sql server 2000 Pin
Colin Angus Mackay22-May-06 1:32
Colin Angus Mackay22-May-06 1:32 
srinuivasaRaoS wrote:
Can any one tell me the actual problem for this


No, because you have not provided enough information. (e.g. What code was running on the SQL Server at the time of the deadlock)


srinuivasaRaoS wrote:
how to avoid this situation


Typically deadlocks occur because two or more things request the same resource while holding on to other resources that the other wants. For example

Process 1                        Process 2
Requests Lock on Table A         Requests Lock on Table B
Gets Lock on Table A             Gets Lock on Table B
Requests Lock on Table B         Requests Lock on Table A
Blocks until Table B released    Blocks until Table A is released
 
Deadlock detection kicks in and one of the processed become the deadlock victim
 
                                 Deadlock victim: 
                                 Lock released on Table B and Transaction Rollsback
Gets Lock on Table B
Completes request.


The solution is to try and ensure that you aquire resources in the same order in each query (easier said than done). So, you can always detect the deadlock in your exception handler (catch block) and re-attempt the query. The SqlException will return a Number of 1205 for a deadlock.

As you are using VS2005 you will have access to the new asyncronous access to the database. You could use this to ensure the application is still responsive while it waits for an answer from the database.


"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)

My: Website | Blog
GeneralRe: Deadlock in the MS Sql server 2000 Pin
srinivasaRaoS29-May-06 2:05
srinivasaRaoS29-May-06 2:05 
GeneralRe: Deadlock in the MS Sql server 2000 Pin
Colin Angus Mackay29-May-06 4:47
Colin Angus Mackay29-May-06 4:47 
GeneralRe: Deadlock in the MS Sql server 2000 Pin
srinivasaRaoS29-May-06 23:48
srinivasaRaoS29-May-06 23:48 
GeneralRe: Deadlock in the MS Sql server 2000 Pin
Colin Angus Mackay30-May-06 12:06
Colin Angus Mackay30-May-06 12:06 
Questiondata binding Pin
maaran21-May-06 23:33
maaran21-May-06 23:33 
AnswerRe: data binding Pin
Frank Kerrigan22-May-06 4:03
Frank Kerrigan22-May-06 4:03 
QuestionIndex seek and Index scan Pin
dayakar_dn21-May-06 23:15
dayakar_dn21-May-06 23:15 
AnswerRe: Index seek and Index scan Pin
woudwijk21-May-06 23:36
woudwijk21-May-06 23:36 
QuestionLooking for MS Access articles Pin
John R. Shaw21-May-06 9:47
John R. Shaw21-May-06 9:47 
AnswerRe: Looking for MS Access articles Pin
Paul Conrad21-May-06 17:52
professionalPaul Conrad21-May-06 17:52 
GeneralRe: Looking for MS Access articles Pin
John R. Shaw23-May-06 12:01
John R. Shaw23-May-06 12:01 
GeneralRe: Looking for MS Access articles Pin
Paul Conrad23-May-06 14:50
professionalPaul Conrad23-May-06 14:50 
QuestionExport to flat file for Microsoft Excel Pin
tanpanjang21-May-06 7:09
tanpanjang21-May-06 7:09 
QuestionODBC questions [modifed] Pin
Lord_Vader20-May-06 0:05
Lord_Vader20-May-06 0:05 
QuestionCannot store 2000 characters in varchar(7000) Pin
Dinuj Nath19-May-06 20:05
Dinuj Nath19-May-06 20:05 
AnswerRe: Cannot store 2000 characters in varchar(7000) Pin
Michael P Butler20-May-06 0:47
Michael P Butler20-May-06 0:47 
GeneralRe: Cannot store 2000 characters in varchar(7000) Pin
Dinuj Nath20-May-06 1:02
Dinuj Nath20-May-06 1:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.