deadlock in sql server 2014

Posted by Modit under Sql Server on 6/22/2017 | Points: 10 | Views : 1984 | Status : [Member] | Replies : 3
We have a .net application hosted in iis. We have a server where we have enabled iis and installed sql server 2014.

From past few days we are facing an issue where query just hangs up, kind of like a deadlock.

We are facing this issue on regular basis, last time when the query hanged while executing we opened sql server profiler and saw many query executing on suspended state.

Right Clicking and Selecting Details nothing happens, same with Trace Process in sql server profiler .

We even enabled Sql Server Profiler to include Deadlock Graph in Locks but nothing showed when issue occured.


Attached zipper containing error images




Responses

Posted by: Pranayshandil on: 6/26/2017 [Member] Starter | Points: 25

Up
0
Down
Check your .NET code.
.NET code and MS SQL Server shares the same service to perform operation on database.
If you are using Transaction then default transaction scope of .NET code is Serializable and MS SQL server is Read Commited.

use below C# code:
TransactionOptions option = new TransactionOptions();
option.IsolationLevel = IsolationLevel.ReadCommitted;
using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.Required, option))
{
// Your database operation
//
//
transactionScope.Complete();
}


Modit, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Modit on: 6/29/2017 [Member] Starter | Points: 25

Up
0
Down
in which namespace is TransactionOptions class found?

Modit, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pranayshandil on: 6/29/2017 [Member] Starter | Points: 25

Up
0
Down
you have to add reference of System.Transactions in your application first.
then add "using System.Transactions;" in your class library.


Modit, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response