SQL Server :: Deadlock Sql Exception?

Jan 7, 2011

My application is a survey application and I am using asp.net 2.0 and sql server 2005 version. There are many users taking survey at a single point of time. Some times delock is coming at a single method where i am deleting some records in a loop one by one(This delete statement may be executed for about 20 question in a page). This is a simple delete statement as below

delete table_name where column_name1='' and column_name2=''

column_name1 has foriegn key constraint, column_name2 also has foriegn key constraint.

The exception is as below.

Transaction (Process ID 204) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction

View 6 Replies


Similar Messages:

SQL Server :: How To Prevent Deadlock

Sep 28, 2010

how to prevent deadlock? read from other forum knowing that even a simple select statement will cause deadlock, but i confuse on how can i prevent it?

View 8 Replies

SqlBulkCopy Causes Deadlock On SQL Server 2000?

May 12, 2010

I have a customized data import executable in .NET 3.5 which the SqlBulkCopy to basically do faster inserts on large amounts of data. The app basically takes an input file, massages the data and bulk uploads it into a SQL Server 2000. It was written by a consultant who was building it with a SQL 2008 database environment. Would that env difference be causing this? SQL 2000 does have the bcp utility which is what BulkCopy is based on. So, When we ran this, it triggered a Deadlock error.

Error details: Transaction (Process ID 58) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

I've tried numerous ways to try to resolve it. like temporarily setting the connection string variable MultipleActiveResultSets=true, which wasn't ideal, but it still gives a Deadlock error. I also made sure it wasn't a connection time out problem. here's the function.

/// <summary>
/// Bulks the insert.
/// </summary>[code].....

View 4 Replies

SQL Server Deadlock While Inserting Rows In A Table

Oct 15, 2010

The topic of sql server deadlock has been discussed many times, however, I was unsure that even two simultaneous inserts on a table can end up in a deadlock situation. Scenario: While testing our application (SQL Server 2005 as backend, ASP.net 3.5) we inserted records into a table simultaneously (simplified overview) and that resulted into a deadlock for more than 70% of users.

I could not get a hang of this as how an insert is being deadlock as this is not a case of multiple resources. After a detailed analysis (of reproducing the bug by two users) I found that both the processes were holding a RangeS-S lock on the primary key index of the table and were trying to convert this into RangeI-N lock, that resulted into a deadlock and one transaction being killed.

Question: Can we avoid or reduce these kind of deadlocks as this is not a case of change in order of access of resources? Cant' we force the transaction to get exclusive lock initially so that it blocks the other process and avoid deadlock? What (adverse) effects that may have? Also could some one explain more about RangeI-N lock.

Isolation Level for this was "Serializable".

View 2 Replies

DataSource Controls :: Recreate Deadlock In A Sql Server 2008 Database?

Jan 12, 2010

a script which creates a deadlock in a Sql Server 2008 database?I want to do a trace in a customer environment using a trace flag but first I want to test it in my own environment.

View 4 Replies

DataSource Controls :: Sql Server Deadlock / Only Inserting/updating Data Into A Table

Jun 11, 2010

I m getting following error in my eventvwr . I couldnt find reasons of the following error.

"Transaction (Process ID 110) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction. "

The only thing my page is doing is inserting/updating data into a table in sql and the thing I can think of is because multiple users are using the same page to insert/update data? Will that cause deadlock?

View 4 Replies

DataSource Controls :: Facing Alot Of Sql Deadlock In My Event Handle On Server Computer?

Jan 18, 2010

I would like to know how deadlock is happen, i have facing alot of sql deadlock in my event handle on server computer.

View 3 Replies

SQL Server :: Communication Buffer Resources With Another Process And Has Been Chosen As The Deadlock Victim. Rerun The Transaction

Nov 15, 2010

While updating table Un handled exception was raised (asp.net with c# and SQLServer 2005)

Error Message: "Transaction (Process ID 91) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction."

View 2 Replies

C# - Why Do Nested Locks Not Cause A Deadlock

Feb 17, 2011

Possible Duplicate:
Re-entrant locks in C#

Why does this code not cause a deadlock?

private static readonly object a = new object();
[code]....

View 3 Replies

DataSource Controls :: Deadlock Transactions?

Feb 1, 2010

I have two databound controls on one page. GridView, DropDownList. My page is crashing with a SQL Transaction deadlock victim error. I would like to capture this error, and attempt to re-databind the controls. My first thought was to handle an event on the controls that allow me to do this, but I don't see which event to handle. I couldn't search any answers. Where should I begin?

View 3 Replies

DataSource Controls :: Will Trigger Still Fire After A Deadlock

May 14, 2010

If an insert statement is the victim of a deadlock, will an insert/update trigger still be fired?

View 3 Replies

DataSource Controls :: DeadLock In Sql/ High Transaction Tables?

May 7, 2010

I was facing some serious deadlock issues in a high transaction table.For some select statement i have added nolock .But for few i can not put nolock, as i need accurate data.this select statement becomes a deadlock victim at times.

View 3 Replies

Exception Handling In Server.transfer

Feb 26, 2011

A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code

After banging my head because i could find where the exception came for and global.asax didn't get hit i found that it's from server.transfer and is a known bug. The alternative i read about is server.execute.However if i do this then the next page fires multiple javascript exceptions and a gridview i have is breaking of and the rows appear half at the left page corner and half inside the gridview!!

For now i just put a try catch on the server.transfer although the exception will not affect the application even if i don't use try catch. I also see that the exception is happening again even if i put try catch but with different dll: A first chance exception of type 'System.Threading.ThreadAbortException' occurred in App_Web_benglxq1.dll An exception of type 'System.Threading.ThreadAbortException' occurred in App_Web_benglxq1.dll but was not handled in user code Now what on earth is benglxq1.dll i don't know. What i know is that i'm leaving an exception to run and i don't like that. This is the js error when i use server.transfer btw: Microsoft JScript runtime error: Sys.ArgumentTypeException: Object of type 'Sys._Application' cannot be converted to type 'Sys._Application'.

View 8 Replies

SQL Server :: Getting Exception When Insert Data?

Aug 18, 2010

I try to insert chinse word into sql server, do anyone know how come sometime it show "system.exception: word too long"; but sometime it work, even the sentences is very long??

View 4 Replies

DataSource Controls :: Getting Exception / An Exception Occurred While Executing A Transact-SQL Statement Or Batch

Jan 1, 2010

i need to restore Database.mdf; I create a blank new database exactly the same name as the .mdf file. However, I could not restore the database.

The error message prompted was:

TITLE: Microsoft SQL Server Management Studio Express

An exception occurred while executing a Transact-SQL statement or batch.

(Microsoft.SqlServer.Express.ConnectionInfo)

ADDITIONAL INFORMATION:

Cannot open backup device 'C:inetpubwwwrootTCPSystemApp_DataDatabase.mdf'. Operating system error 32(error not found).

RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201)

click: [URL]

BUTTONS:

OK

View 10 Replies

Architecture :: How To Log Dal Exception And Showing Alert To User / Exception Occurs

Aug 3, 2010

I am working on a 3-tier asp.net application. Currently I'm stuck up in a situation where I need to handle a specific type of exception (User Defined) in DAL and Show alert to the user if that exception occurs in DAL.

I tried following things:

1) I raised that exception from the DAL and catch it in BLL and throw a new BLL exception to for that DAL exception and finally catch it in the UI layer to show the alert to the user. I've successfully implement this in my project. But there are some issues in this approach. First of all I feel this is not right way to do this as it may lead to performance related issues. Secondly, the application contains more than 500 pages and classes. so I need to attach additional catch block in every method to catch the BLL exception. which is the last option i'd like to take.

2) in second approach I logged the the DAL exception into a text file. but problem in this approach is that how could the UI layer know that exception has occurred and show the alert to the user. Is there any event in asp.net where i could handle all this activities?

my question is what is the best approach to handle this type of situation? Will Exception handling block help me in this?

I've tried reading many articles on this but i couldn't get an answer for my question? I might not be using right keywords for my search.

View 4 Replies

C# - How Do I Get Specific Details About An Exception From A General Exception Class Object

Feb 4, 2010

In ASP.NET,How can i know the Specific details about an exception (like What kind of Exception it is (FileNotFound /Arithmentc etc..) )from a General Exception class object.

View 2 Replies

MVC :: Security Exception When Using MVCcontrib Grid On Server

Jun 21, 2010

I am using MVCcontrib grid in my application. Everything works fine on my dev machine. When I publish it to the server and navigate to the page that renders the grid I am getting this error Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. and the source of the error is shown as <%= Html.Grid(Model).Columns(column => {i have added

[Code]....

to the web.config but still&nbsp;get the error&nbsp;

&nbsp;
</textarea></p>
<input type='hidden' name='ID[9]' value='93970' />
<input type='hidden' name='URL[9]' value=[URL]/>
<input type='hidden' name='CAT[9]' value='DataSource Controls' />
<input type='hidden' name='BOARD[9]' value='microsoft' />
<input type='hidden' name='P_DATE[9]' value='Jan 12, 2010 09:43 PM' />
<input type='hidden' name='RANDOM[9]' value='BcIlUOXzN' />
<input type='hidden' name='REPLIES[9]' value='3' />
<input type='hidden' name='USER[9]' value='aziz' />
<p><input class=subject type='text' size='90' name='SUBJECT[9]' value='DataSource Controls :: LINQ using stored procedures and MvcContrib Grid with pagination' /><select name='INDEXED[9]'><option value='1' selected>UPDATE</option><option value='2'>DELETE</option></select>Jan 12, 2010 09:43 PM - Replies: 3 CAT: DataSource Controls<a target=_blank href=[URL]>View</a></p>
<p> <textarea rows=10 cols=100 name='POST[9]' onfocus='setSelRange(this, 0, 0)'/>All,

I have been chasing this erorr all day and coming up blank.&nbsp; I created a stored proceudre(fairly complicated logic), added it to the context, and set the return type to a specific entity type.

It generated this:

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;
[Function(Name="dbo.usp_ServiceTemplateSelectByFkID")]
public ISingleResult<ServiceTemplate> usp_ServiceTemplateSelectByFkID([Parameter(Name="FkId", DbType="Int")] System.Nullable<int> FkId)
{
&nbsp;&nbsp;&nbsp; IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), FkId);
&nbsp;&nbsp;&nbsp; return ((ISingleResult<ServiceTemplate>)(result.ReturnValue));
}

I call it from my service with the following method:

public ISingleResult<ServiceTemplate> GetByFkId(int FkId)
{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return Db.usp_ServiceTemplateSelectByFkId(FkId);
}

I have tested the stored procedure and it returns the results I want.&nbsp; When I make the service call from the controller, it doesn't error out, however, it should return 4 records in this instance and instead, it returns the same 4 records (repeating the first record 4 times).&nbsp;.........

View 4 Replies

Web Forms :: Out Of Memory Exception On Remote Server

Oct 18, 2010

I'm not sure why but on random occassions after I have added an update to my site via ftp and then try to access the site through the browser I get an "out of memory" exception. But there are no infinite loops or problems like that. Then after some time it will then work (I assume the web hosts restart IIS or something) and all is fine again. Server Error in '/' Application. Exception of type 'System.OutOfMemoryException' was thrown. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
Source Error:

[Code]....

Stack Trace:

[Code]....

View 3 Replies

Padarn Web Server Project Throwing Exception?

Feb 14, 2011

I'm testing our OpenNetCF's Padarn Web Server.

In one of their Hands-On-Labs (HOL P101), an exception is being thrown at

private WebServer m_padarnServer = new WebServer();

The exception reads, "Exception in ConfigSectionHandler".

If you have experience with Padarn, have you received this exception before? If so, can you shed some light as to what I may do to debug this error?

View 1 Replies

C# - Exception Handling - Implement Custom Exception Classes?

Jul 2, 2010

i have this application structure:

1. Presentation Layer which calls

2. Business Logic Layer which in turn calls

3. Data Access Layer to do the dealing with the database.

Now i have a Contacts page from where i can add a new contact to the database.So to add a New Contact i fill in all the required details and then call a Add Method (residing in the BLL) from the page, which in turn call a Add Method residing in the DAL.this method in the DAL returns the Current Identity of the record which is then return back to the BLL method and finally delivered on the page.this is fine. but what if a get an exception how do i handle it properly because the method in DAL has a return type of int and i dont want to throw another error!! coz other wise i will have to write try catch in almost all the methods.

//something like this
public int AddMethod(ContactClass contactObj)
{
int result = 0;[code]...

rather i want to show the user a user-friendly message which they can easily understand and in the mean while i will send a mail to myself documenting the Error that just occurred.how can i implement my custom exception classes.

View 2 Replies

SQL Server :: Is There A Class Spesific To Unique Constraint Exception

Feb 15, 2011

When I get an exception message like this I want an Exception Class name to compare.Not wantto compare a string to match with substring.when I get an unique constraint error like this below how can I control if error exception type is exactly sqlserver unique constraint error ?:

catch (Exception ex)
{ if (ex.class==SQLUniqueException) blahblah();
};

View 2 Replies

Custom Server Controls :: How To Hide Code From Exception

Feb 24, 2010

I have a custom control. Some properties throw a custom error message when no value is supplied. The message shows up fine, but also does the code. For example ...

Custom Message Here

... and then in the yellow box the code ...

throw new Exception("Custom Message Here");

How can I hide the code portion?

View 1 Replies

Unhandled Exception Has Occurred. Unknown Server Tag 'asp:ListView'?

Dec 2, 2010

Suddenly I got this message:

unhandled exception has occurred. unknown server tag 'asp:ListView'

What can be wrong with the project?

View 1 Replies

SQL Server :: Solve Divide By Zero Exception In SQL Stored Procedure?

Jan 30, 2011

When I am executing my stored procedure it is throwing Divide By zero Exception. Because In my database there is no data for some months. How can I solve this?

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved