-1

I know what is DeadLock and how database generated. My goal is to clarify this issue thoroughly to record.

1- How can i handle deaed locks in sql server? Is there any library or tool to handle theme?

2- In a real time scenario how can i force while my database takes much requests in a short time. For example: i have 8 dedicated server and they are taking 20 000-40 000 per request in one second.

a-> Which is the best Load Balancing tool especially if i want to escape the dead-locks

b-> Which layer is perfect for load balancing is it should be on physical-layer or software-layer or both. Of course is both but how is in your experiences? For example how is netscaler in physically? I want to know their advantages and disadvantages?

Hamit YILDIRIM
  • 4,224
  • 1
  • 32
  • 35
  • 1
    If you don't know what a deadlock is, you should start [here](https://technet.microsoft.com/en-us/library/ms177433(v=sql.105).aspx). It's not a simple topic that can be explained in a question; it's too broad. The bottom line is that you can code to make deadlocks less common, but you can essentially *never* eliminate them entirely. Your application just needs to be able to handle them when they happen. – Bacon Bits Dec 21 '15 at 20:07
  • 1
    Short answer: Try Snapshot Isolation: http://www.brentozar.com/archive/2013/01/implementing-snapshot-or-read-committed-snapshot-isolation-in-sql-server-a-guide/. This stuff is complicated though. You should first isolate whether particular queries are causing deadlocks. And here's a link for that: http://www.brentozar.com/archive/2014/06/capturing-deadlock-information/. I'm just posting links because you need to read and understand these then post a specific question. – Nick.Mc Dec 21 '15 at 22:59

1 Answers1

1

This is a long formatted comment. In some of my ColdFusion applications, I have taken the following approach to handling deadlocks.

  • put the cfquery tag into a function that returns a ColdFusion query object.
  • Attempt to call that function using try/catch a maximum of 3 times
  • Throw an error if still unsucessful

This approach is not limited to ColdFusion. It can be applied to .net, php, java, and even tsql.

Also, it will not eliminate the deadlock problem. It will however, reduce the amount of times it happens.

Dan Bracuk
  • 20,699
  • 4
  • 26
  • 43