February 27, 2006 at 1:35 pm
ive seen this Deadlock Error message out on the internet being discussed, but no solution being offered.
i have a windows service that's running Select Statements [one at a time] - so unless there's some command in sql server that would re-run these - it could be a problem for me.
now if im running this select proc manually - of course i see the message and re-run the process, but how can this be accomplished programatically.
see msg below:
Transaction (Process ID 106) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
thanks for any help on this
rik
February 28, 2006 at 5:52 am
Switch traceflag 1204 on on the server and whenever SQL encounters a deadlock it will write a deadlock graph into the error log. that can help you track down the other half of the deadlock and should give you enough infoto fix the problem.
There's no single one-size-fits-all solution to deadlocks. You've got to see teh transactions on each side and work out why they're deadlocking and then take steps to fix them.
They can usually be fixed by one or more of the following
- appropriate indexes on the tables
- rearranging statements within a transaction
- removing unnecessary statements from a transaction block
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 28, 2006 at 6:00 am
darn, i was afraid the answer wouldnt be simple. i'll use your suggestion and see if i can locate the culprit.
thanks again
rik
February 28, 2006 at 9:01 am
If you are not concerned about "dirty reads" you can use the with (nolock) statement or Set Transaction Isolation Level Read Uncommitted on the select statements being run.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply