SQL Server :: Deadlocked Transaction On Lock Resources
Sep 24, 2010
I develop an application using LINQ to SQL. Recently I deploy the application on server and starts performance testing using WAPT for 100 users. Unfortunately, 90 requests are failed while placing an order and only 10 are passed. I analyse and found that for every failed request I got an error "System Exception: Transaction (Process Id 68) was Deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction."
View 5 Replies
Similar Messages:
May 11, 2010
I have an invoke function that I call. It On the client side it reads a file and then sends the line to the server side function here and waits for a return. Here is the server side code:
[Code]....
What I find is that I will keep getting these error message as posted in the subject... It will work for some but others I get this message. Thoughts on how to avoid that, or is that just something I'll need to work around with timing?
View 1 Replies
Jul 23, 2010
I have a stored procedure which fetches data after joining 8-9 tables and inserts that into a temp table. It was running fine till now, but now when the amount of data fetched have exceeded 20000, the SP is breaking. I have debugged the sp and found that this main query is failing after returning arround 15000-16000 records.
The error message says Transaction (Process ID) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. I know what is deadlock, but when i checked with SP_LOCK stored proc i only found that my process is running on database only. So how is this getting deadlocked when there are no other processes running simultaneously on server.
View 4 Replies
Oct 21, 2010
I have a deadlock problem that occurs every 5 minutes on SQL update. I get the following error randomly - means qurey failed one time every 200 calls. I'm using transaction scope to manage transaction.
code:
using(TransactionScope scope =
new
TransactionScope())
{
SELECT ... FROM TABLE1
UPDATE TABLE1 SET [F1] = @F1, [F2] = @F2, [F3] = @F3, [F4] = @F4, [F5] = @F5 WHERE UId = @UId
scope.Complete();
}
error:
System.Data.SqlClient.SqlException: Transaction (Process ID 51) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction
stack trace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DAL.RunSQL(String query, SqlParameter[] parameters, Boolean openTransact) in C:prjDAL.cs:line 215
I took trace in SQL about deadlock and same SQL query is mentioned bu deadlock. I do not understand how to resolve this deadlock.
SQL log:
deadlock-list
deadlock victim=process5462718
process-list
process taskpriority=0 logused=0 waitresource=KEY: 20:72057597472604160 (ce004d0b917a) waittime=30 ownerId=5937428 transactionname=user_transaction lasttranstarted=2010-10-20T16:29:04.050 XDES=0x5d00280 lockMode=X schedulerid=2 kpid=2168 status=suspended
spid=65 sbid=0 ecid=0 priority=0 trancount=2 lastbatchstarted=2010-10-20T16:29:04.110 lastbatchcompleted=2010-10-20T16:29:04.110 clientapp=.Net SqlClient Data Provider hostname=IPTBEWKS017 hostpid=3112 loginname=iptuserjde isolationlevel=serializable (4) xactid=5937428
currentdb=20 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
executionStack
frame procname=adhoc line=1 stmtstart=222 sqlhandle=0x0200000086adfa0c959ccbdd7ef0e31e854e3a987706ae38
UPDATE TABLE1 SET [F1] = @F1, [F2] = @F2, [F3] = @F3, [F4] = @F4, [F5] = @F5 WHERE UId = @UId
frame procname=unknown line=1 sqlhandle=0x000000000000000000000000000000000000000000000000
unknown
inputbuf
(@UId nvarchar(9),@F1 nvarchar(9),@F2 nvarchar(9),@F3 int,@F4 int,@F5 datetime)UPDATE TABLE1 SET [F1] = @F1, [F2] = @F2, [F3] = @F3, [F4] = @F4, [F5] = @F5 WHERE UId = @UId
process taskpriority=0 logused=0 waitresource=KEY: 20:72057597472604160 (cc0078aef293) waittime=88 ownerId=5937412 transactionname=user_transaction lasttranstarted=2010-10-20T16:29:04 XDES=0x2b028280 lockMode=X schedulerid=1 kpid=6788 status=suspended
spid=74 sbid=0 ecid=0 priority=0 trancount=2 lastbatchstarted=2010-10-20T16:29:04.050 lastbatchcompleted=2010-10-20T16:29:04.050 clientapp=.Net SqlClient Data Provider hostname=IPTBEWKS017 hostpid=3112 loginname=iptuserjde isolationlevel=serializable (4) xactid=5937412
currentdb=20 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
executionStack
frame procname=adhoc line=1 stmtstart=222 sqlhandle=0x0200000086adfa0c959ccbdd7ef0e31e854e3a987706ae38
UPDATE TABLE1 SET [F1] = @F1, [F2] = @F2, [F3] = @F3, [F4] = @F4, [F5] = @F5 WHERE UId = @UId
frame procname=unknown line=1 sqlhandle=0x000000000000000000000000000000000000000000000000
unknown
inputbuf
(@UId nvarchar(9),@F1 nvarchar(9),@F2 nvarchar(9),@F3 int,@F4 int,@F5 datetime)
UPDATE TABLE1 SET [F1] = @F1, [F2] = @F2, [F3] = @F3, [F4] = @F4, [F5] = @F5 WHERE UId = @UId
resource-list
keylock hobtid=72057597472604160 dbid=20 objectname=dbipt_rc41_02.dbo.TABLE1 indexname=PK_TABLE1 mode=RangeS-U associatedObjectId=72057597472604160
owner-list
owner id=processdbbe40 mode=RangeS-S
waiter-list
waiter mode=X requestType=convert
keylock hobtid=72057597472604160 dbid=20 objectname=dbipt_rc41_02.dbo.TABLE1 indexname=PK_TABLE10 mode=RangeS-U associatedObjectId=72057597472604160
owner-list
owner mode=RangeS-S
waiter-list
waiter id=processdbbe40 mode=X requestType=convert
I have tried to analyse the trace with this post but unsuccessfully: [URL] UId is my primary key - I do select on F3 column just before in same transaction but i have also an index on F3 column.
->
Spid 65 is running this query (line 2 of proc [p1]):
UPDATE TABLE1 SET [F1] = @F1, [F2] = @F2, [F3] = @F3, [F4] = @F4, [F5] = @F5 WHERE UId = @UId
Spid 74 is running this query (line 2 of proc [p2]):
UPDATE TABLE1 SET [F1] = @F1, [F2] = @F2, [F3] = @F3, [F4] = @F4, [F5] = @F5 WHERE UId = @UId
View 5 Replies
Aug 31, 2010
is there a way do something like this:
[Code]....
View 5 Replies
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
Jun 15, 2010
I've got all of my ASP.NET requests wrapped in a Session and a Transaction that gets commited only at the very end of the request. At some point during execution of the request, I would like to insert an object and make it visible to other potential threads - i.e. split the insertion into a new transaction, commit that transaction, and move on. The reason is that the request in question hits an API that then chain hits another one of my pages (near-synchronously) to let me know that it processed, and thus double submits a transaction record, because the original request had not yet finished, and thus not committed the transaction record.
So I've tried wrapping the insertion code with a new SessionScope, TransactionScope(TransactionMode.New), combination of both, flushing everything manually, etc. However, when I call Refresh on the object I'm still getting the old object state. Here's some code sample for what I'm seeing:
Post outsidePost = Post.Find(id); // status of this post is Status.Old
using (TransactionScope transaction = new TransactionScope(TransactionMode.New))
{
Post p = Post.Find(id);
p.Status = Status.New; // new status set here
p.Update();
SessionScope.Current.Flush();
transaction.Flush();
transaction.VoteCommit();
}
outsidePost.Refresh();
// refresh doesn't get the new status, status is still Status.Old
View 1 Replies
Jan 10, 2011
How to row lock in SQL Server 2005. I execute a sql for row locking and that is
SELECT *
FROM authors
WITH (HOLDLOCK, ROWLOCK)
WHERE au_id = '274-80-9391'
it work fine but in this case row is lock for update not for selection. I just want to know how to lock a row as a result another user can not see that row when issue a SQL in SQL Server. please guide me. thanks
View 3 Replies
Apr 23, 2010
How do I go about securing files that are stored on the server? We have an ASP.NET app which generates PDFs. These are not stored in the wwwroot folder but in another folder i.e. C:inetpubdata. This provides more security but maybe not enough. The ASP.NET/IIS process will need write access to this folder so it generate the PDFs there.
Once the pdf is generated, it can be viewed using an ASP.NET form called viewpdf.aspx with the file to be viewed add to the query string like so viewpdf.aspx?FILE=mynewfile.pdf. This is loaded from a gridview.
The full path to C:inetpubdata is resolved and loaded in the Page_load event of the viewer page. Now I'm wondering how to secure this. Anybody could just view the file. Not by entering in the URL, as it won't been seen by IIS (its not in wwwroot), but could change the querystring in the viewpdf page.
How do I stop anybody hacking this?
View 3 Replies
Oct 15, 2010
i want to know Advantage and Disadvantage of lock in OLTP system??
View 2 Replies
Sep 22, 2010
Reposting my unanswered in technet.microsoft question?
MSDN "ASP.NET Delegation" article tells:
1) "When you configure to use a particular account as the process identity, ASP.NET attempts to delegate that account. If it is a local account that is identical (including password) to a local account on a remote machine, delegation is possible. If such an account does not exist on the remote machine, to the network it appears as the Windows anonymous account (NT AUTHORITYANONYMOUS LOGON). In addition, delegation is also possible if the account is a domain account that has access to the remote machine, in which case it uses the domain network identity of that account."
The same frequently repeated story as in case of manually/interactively accessing remote computer (server resource) in workgroup - it is necessary to create local account with the same username, the same password. But why?
If a workgroup Windows client process cannot access resources on server machine without having duplicate of such (local) account on target machine already pre-created,does it mean that client (process, machine, or user) can access server resources only by/after having logged (opening logon session) into server machine? Or, how to understand that such access is impossible without having corresponding duplicate local account on server machine?
The same MSDN "ASP.NET Delegation" article tells:
"NetworkService account. It behaves the same as the System account. This account possesses the network credentials associated with the machine account (domainnamemachinename) in the domain of which it is a member"
Does not any Windows have accounts ((NT AUTHORITYNETWORK SERVICE)? as well as many other common pre-built accounts? Why are they installed (before any joining to domain) but cannot be used for remote network access and client identification ? And what is identity used when the process from workgroup Windows under identity ((NT AUTHORITYNETWORK SERVICE) accesses a remote server?
My related questions:
domained LocalSystem vs. non-domained LocalSystem account in Windows-es ? how to check group membership of an "NT AUTHORITY" account ? Is client LocalSystem (SYSTEM) identified by target/server machine? and in which context? Window workgroup LocalSystem vs. domain (AD) LocalSystem [closed]how to better set up machine for development both in workgroup and Windows domain? [closed] interoperating with Windows domain computer from workrgroup Windows [closed] the context of local user of AD-joined machine? Is it of domain machine account or of local machine account? RunAs under domain account from non-AD Windows [closed] how to better set up machine for development both in workgroup and Windows domain? [closed] how to share the same domain machine account with multi-boot workgroup Windows setup?
View 1 Replies
Nov 12, 2010
detail and also examples of transaction modes where i can get easily concepts of transaction modes1 Autocommit Mode2 Implicit Mode3 Explicit Mode
View 3 Replies
Dec 10, 2010
table 1
[Code]....
Table 2
[Code]....
my stored procedure
[Code]....
when ever i m passing the wrong the value in second table while updating its not updating the table but the problem it is inserting the value in first table i want the whole trans should proceed if success if not rollback
View 2 Replies
Sep 23, 2010
I know these 2 commands
sp_who and sp_who2 → knowing who are updateing
DBCC log (DB_NAME,4) → I can't really understand these information..
just wondering does there exists a log file, so we can check who have updated database from it?
View 3 Replies
Jan 24, 2011
I have a multiple database operation, Have three tables (MSsql) and need to delete one row in each table in one operation, one after another. (Three functions, three rows of code). Everything is working as it should be, recently I was advised to use a transaction scope, which should guarantee the safety of deletion from all 3 tables together.
Here is my new code:
[Code]....
Locally all worked just fine, the transaction scope worked well, but when I have uploaded my application to my hosting server, I got an error of: The partner transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D025).I talked with the host support, they tried to do something, then I got this error: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
After a 2 days, They have contacted me, they said it is not possible to disable some restriction, that will allow an access to this operation, because I'm using shared hosting, and I need to upgrade my plan to VPS. VPS is a very expensive for me, and I can't afford it, What I'm looking is a some similar way of doing the same operation as transaction scope do, that may work at my hosting, At least I would like to try something else. Is there any additional way for the transaction scope?
View 1 Replies
Jan 20, 2011
I need a windows service. This service will start when userId insert on myDatabase.And after I want to handle this userId send
to my web service.If webservice return true I insert this userId another table on mydatabase. How can I write this?
View 5 Replies
May 18, 2010
I have a big excel file , and i want to upload it to server.
on upload_click , i have to do a processing which takes very long time,
because i am finding latitude and longitude from the google by reading that excel file.
and i wanted that when used click on CANCEL button the process should stop.
i have created a thread on upload_click and doing all this stuff in that thread .
when user clicks on CANCEL , i am aborting that thread.
but when user again tries to upload file , i am getting the error that file is in use .
to solve this problem i have to stop aspnet_wp.exe from task manager and have to try again .
View 1 Replies
Dec 23, 2010
I using System.Transactions on webservices hosted on different domains.Transaction on same domain works fine.But problem is with the distributed/different domains.
I ve tested with the dtctester and the output is as follows...
Initializing DTC
Beginning DTC Transaction
Enlisting Connection in Transaction
Error:
SQLSTATE=25S12,Native error=-2147168242,msg='[Microsoft][ODBC SQL Server Driver]
Distributed transaction error'
Error:
SQLSTATE=24000,Native error=0,msg=[Microsoft][ODBC SQL Server Driver]Invalid cur
sor state
Typical Errors in DTC Output When
a. Firewall Has Ports Closed
-OR-
b. Bad WINS/DNS entries
-OR-
c. Misconfigured network
-OR-
d. Misconfigured SQL Server machine that has multiple netcards.
Aborting DTC Transaction
Releasing DTC Interface Pointers
Successfully Released pTransaction Pointer.
View 1 Replies
Feb 3, 2011
I have recently upgraded to VS 2010 and converted my web site into a web application. Now, when I attempt to build, I receive the error:
Resource name '<name>.Resources.resources' cannot be used more than once.
There is no page name or anything, and I have completely exhausted all that Google has to offer.
View 2 Replies
Feb 10, 2011
I have to write stored proc to get the daily transaction for a specified date. Right now what i do is everytime i log a transaction in table3 I update table 2 with the count. Then i use table 2 to write the stored proc and to get the desired result. I have pasted my stored proc below with the output. My problem is when another subsystem is added in the AppInfo table i need to update my stored proc because i have hardcoded the subsystem name.
[Code]....
View 4 Replies
Dec 14, 2010
I am getting following error ...when trying to do any operation....
"The transaction log for database 'MyDatabase' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc
column in sys.databases"
I tried to shirnk file log file using ...
dbcc shrinkfile(EMRSET_log,1) But still same issue....And its show ...
DBName 4 ACTIVE_TRANSACTION (log_reuse_wait, log_reuse_wait_desc) ...
What steps i do to resolve this issue. Using MS SQL 2008
View 2 Replies
Jan 28, 2011
I have a masterPage that has several labels populated by a Global Resource file. For some reason every time I add a entry to the Spanish global resource file and precompile my website and move out the App-GlobalResources.compiled and App_GlobalResources.dll. The changes/Updates do not seem to be reflected on the Prod Web Server. Am I missing a file I need to move to the server? the update is working fine when I run the site locally.
View 1 Replies
Jan 22, 2010
I'm trying to create a web server control with a css embedded in the assembly.
I marked it as an embedded resource, add assembly attribute to reference it and use the proper methods to include the link to that
css in html code... my page renders ok witk something like <link href='/WebResources.axd?....' />
That's when the problem appears! My control isn't using the css as it appears to not found webResources.axd
I tried directly in web browser to locate http://locahost/mysite/WebResources.axd and it came with http code 404 NOT FOUND
In my IIS i have uncheked "Verify if file exists" on my extensions mapping related to .axd I add HEAD verb in Web.Config to path WebResources.axd and the result is always the same
View 3 Replies
Jul 15, 2010
I'm making changes to some xxx.resources files on our web server, everytime I try and copy the new file out to the server I keep getting the error:
'the process cannot access the file because it is being used by another process.'
I get this for about 20 minutes or so after I check the web site. Is there another way to update/copy the xxx.resources file on the web server without waiting 20 minutes or so to do so?
View 2 Replies
Apr 3, 2011
I am wondering if ASP.NET is a good choice to build small such as personal websites, blogs, photo gallery to medium websites such as online booking, medium sort of facebook!, etc?I have heard that ASP.NET and MS SQL Server take more resources than PHP and MySQL which means it could be only good for rich people who are able to pay for these resources!
View 12 Replies