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 624451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:12:08+00:00 2026-05-13T19:12:08+00:00

Here’s my situation (SQL Server): I have a web application that utilizes nHibernate for

  • 0

Here’s my situation (SQL Server):

I have a web application that utilizes nHibernate for data access, and another 3 desktop applications. All access the same database, and are likely to utilize the same tables at any one time.

Now, with the help of NH I’m batching selects in order to load an aggregate with all of its hierarchy – so I would see 4 to maybe 7 selects being issued at once (not sure if it matters).

Every few days one of the applications will get a : “Transaction has been chosen as the deadlock victim.” (this usually appears on a select)

I tried changing to snapshot isolation on the database , but that didn’t helped – I was ending up with :

Snapshot isolation transaction aborted
due to update conflict. You cannot use
snapshot isolation to access table
‘…’ directly or indirectly in
database ‘…’ to update,
delete, or insert the row that has
been modified or deleted by another
transaction. Retry the transaction or
change the isolation level for the
update/delete statement.

What suggestions to you have for this situation ? What should I try, or what should I read in order to find a solution ?

EDIT:

Actually there’s no raid in there :). The number of users per day is small (I’ll say 100 per day – with hundreds of small orders on a busy day), the database is a bit bigger at about 2GB and growing faster every day.

It’s a business app, that handles orders, emails, reports, invoices and stuff like that.

Lazy loading would not be an option in this case.

I guess taking a very close looks at those indexes is my best bet.

  • 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-13T19:12:08+00:00Added an answer on May 13, 2026 at 7:12 pm

    Deadlocks are complicated. A deadlock means that at least two sessions have locks and are waiting for one another to release a different lock; since both are waiting, the locks never get released, neither session can continue, and a deadlock occurs.

    In other words, A has lock X, B has lock Y, now A wants Y and B wants X. Neither will give up the lock they have until they are finished with their transaction. Both will wait indefinitely until they get the other lock. SQL Server sees that this is happening and kills one of the transactions in order to prevent the deadlock. Snapshot isolation won’t help you – the DB still needs to preserve atomicity of transactions.

    There is no simple answer anyone can give as to why a deadlock would be occurring. You’ll need to profile your application to find out.

    Start here: How to debug SQL deadlocks. That’s a good intro.

    Next, look at Detecting and Ending Deadlocks on MSDN. That will give you a lot of good background information on why deadlocks occur, and help you understand what you’re looking at/for.

    There are also some previous SO questions that you might want to look at:

    • Diagnosing Deadlocks in SQL Server 2005
    • Zero SQL deadlock by design

    Or, if the deadlocks are very infrequent, just write some exception-handling code into your application to retry the transaction if a deadlock occurs. Sometimes it can be extremely hard (if not nearly impossible) to prevent certain deadlocks. As long as you write transactionally-safe code, it’s not the end of the world; it’s completely safe to just try the transaction again.

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

Sidebar

Ask A Question

Stats

  • Questions 443k
  • Answers 443k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you dont' use float on the container it's width… May 15, 2026 at 6:23 pm
  • Editorial Team
    Editorial Team added an answer First off, changing the primary key value is never a… May 15, 2026 at 6:23 pm
  • Editorial Team
    Editorial Team added an answer If what you want is to define the type of… May 15, 2026 at 6:23 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.