Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6167281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:29:02+00:00 2026-05-23T22:29:02+00:00

So as I understand it, SQL deadlocks happen when a SPID is busy processing

  • 0

So as I understand it, SQL deadlocks happen when a SPID is busy processing another query and it can’t be bothered to run another one because it’s so busy right now. The SQL Server “randomly” picks one of the queries to deadlock out of the resources asked for and fails it out, throwing an exception.

I have an app running ~ 40 instances and a back-end Windows Service, all of which are hitting the same database. I’m looking to reduce deadlocks so I can increase the number of threads I can runs simultaneously.

  1. Why can’t SQL Server just enqueue the new query and run it when it has time and the resources are available? Most of what I’m doing can wait a few seconds on occasion.
  2. Is there a way to set Transaction Isolation Level globally without having to specify it at the onset of each new connection/session?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:29:03+00:00Added an answer on May 23, 2026 at 10:29 pm

    Your understanding of deadlocks is not correct. What you’ve described is blocking. It’s a common mistake to equate the two.

    A deadlock occurs when two separate transactions each want different resources and neither will release the one that they have so that the other can run. It’s probably easier to illustrate:

    SPID #1 gets a lock on resource A
    SPID #2 gets a lock on resource B
    SPID #1 now needs a lock on resource B in order to complete
    SPID #2 now needs a lock on resource A in order to complete

    SPID #1 can’t complete (and therefor release resource A) because SPID #2 has it
    SPID #2 can’t complete (and therefor release resource B) because SPID #1 has it

    Since neither SPID can complete one has to give up (i.e. be chosen by the server as the deadlock victim) and will fail.

    The best way to avoid them is to keep your transactions small (in number of resources needed) and quick.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I understand that I can change a sql table using the follow sp: EXEC
As far as I can understand, when I new up a Linq to SQL
I do understand SQL querying and syntax because of previous work using ASP.NET web
Does anyone have good reference which can help me understand JSTL SQL Basics I
Firstly please understand that SQL is not one of my strong areas at the
Hi I don't understand this simple SQL query with JOIN . I want to
Well, I think trying to understand someone elses SQL can be trying enough but
Good morning, everyone. I need some query help. You can assume I understand relatively
I understand that SQL Server endpoint returns data using SOAP. Does anyone know if
When attempting to understand how a SQL statement is executing, it is sometimes recommended

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.