Transaction Deadlocked On Lock Communication Buffer Resources With Another Process

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


Similar Messages:

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

SQL Server :: Error "Transaction (Process ID) Was Deadlocked On Lock Resources With Another Process And Has Been Chosen"

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

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

ADO.NET :: Transaction (Process ID 51) Deadlocked On Lock

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

SQL Server :: Communication With The Underlying Transaction Manager Has Failed?

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

SQL Server :: Lock Tables During A Transaction?

Aug 31, 2010

is there a way do something like this:

[Code]....

View 5 Replies

Web Forms :: Buffer Cannot Be Null / Parameter Name - Buffer

Nov 9, 2013

I am using Http handler page to get images from database into gridview using C# in asp.net.I am trying to delete the selected row from database, when I click on delete button the row is deleted and the page redirecting to http handler page and firing the error "'Buffer cannot be null. Parameter name:Buffer'".And one more thing is I don't want to go to execute every time pageload event, how can I control this event also.

View 1 Replies

Transaction When App Pool Recycles Or The Worker Process Is Terminated Forcefully

Apr 13, 2010

The architecture of the application is straight forward. There is a web application which maintain account holder data. This data is processed and the status of account holders is updated based on number of business rules. This process is initiated using a button on the page and is a long running process (say 15 mins). A component is developed to do this data processing which internally calls stored procedures. Most of the business rules are kept in stored procedure.

View 2 Replies

DataSource Controls :: Cannot Read Committed Rows While Another Transaction Is In Process

May 3, 2010

i have a method that do bunch of inserts in a table

these inserts done through a transaction (with default isolation level)

meanwhile i need to read some committed records from this table by using another method, i create another transaction for 2th method with a ReadCommitted isolation level but it just fails and return a timeout error and also, the DoTransaction cause the entire table inaccessible, how could i apply a row-level lock ?

[Code]....

View 5 Replies

Documentation Or Resources That Describes The Complete Process Flow Of An Application?

Jul 12, 2010

if there's any documentation/resources the describes the complete process flow of an ASP.Net application? Looking for something that describes IIS handing off the HttpRequest and the usage of the PageParserFilters and such.

View 1 Replies

Web Forms :: What Is The Best Way To "lock" A Process

Apr 30, 2010

Here is the scenario...An authenticated user can earn points and later spend it on some items.Each item has fix value for each entry, where user can spend for that.For example user has 100 points and an item needs 40 points for each entry. User allows to spend as much as points he wants for an item, which in this case he can spend max 80 points and get 2 entries.

The problem is, there is a chance that a user try to spend more than what he is allow by logging in from different browsers or computers and add these entries at the same time. Although there is server side validation but there is still a chance that he passes the validation.The work around was to restrict user to login only once which is not feasible solution.

Put a lock on static object and make sure it will not tampered by other threads.But what if 1000 users or even more want to add an entry at the fairly same time? I don't want make user wait so long...What is the best solution to deal with these type of scenarios.. I have read so much but really din get any good answer..

View 6 Replies

Does Access To Server Resources Require Client Process To Login To Server Machine

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

Flush Separate Castle ActiveRecord Transaction And Refresh Object In Another Transaction

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

Web Forms :: Resource Name '.Resources.resources' Cannot Be Used More Than Once

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

C# - Buffer Image From External Link

Jan 12, 2011

I have a external link with an image which i want to stream, but i get this error when i try. error "URI formats are not supported."

I tried to stream:
Stream fileStream = new FileStream("[URL]", FileMode.Open);
byte[] fileContent = new byte[fileStream.Length]

View 2 Replies

.net - Using HttpCache To Buffer Data From A Web Service?

Aug 15, 2010

What problems might I encounter by using the HttpCache to buffer data from a web service, as opposed to storing the same data in a database table? In a hypothetical situation whereby the service was temporarily unavailable, if the server needed to reboot during that time there would be no way to re-populate the cache. So for that reason, is it possible to persist the cache like you could do with SqlServer Session state?

I read the HttpCache is implemented using the Singleton pattern. Does that mean I should be using Mutex when working with objects coming from the cache?

What will happen if the cache is being updated on the one hand by a separate threaded process while also being read by a different thread?

View 1 Replies

SQL Server :: Data For The Column Xx Is To Large For The Specified Buffer Size?

Feb 17, 2011

I have a DTS script which transforms a Tab delimited text file to a table. I get the following error when trying to transform the data of a field that is greater than 255 chars:

[Code]....

I have seen this issue with importing from Excel with the jet 4.0 engine, however I am importing a text file.

View 3 Replies

SQL Server :: Can Explicitly Store Data Into Buffer Cache

Dec 13, 2010

one of my stored procedure has 4 select statments and gets data from large tables,

can i explicitly store result of stored procedure into buffer cache?,

and when calling stored procedure, than returns data from buffer cache?

View 2 Replies

C# - Will HttpResponse - Filter Buffer The Whole Data Before Start The Sending?

Apr 6, 2010

An user posts this article about how to use HttpResponse.Filter to compress large amounts of data. But what will happen if I try to transfer a 4G file? will it load the whole file in memory in order to compress it? or otherwise it will compress it chunk by chunk?

I mean, I'm doing this right now:

public void GetFile(HttpResponse response)
{
String fileName = "example.iso";
response.ClearHeaders();
response.ClearContent();
response.ContentType = "application/octet-stream";

[Code]....

So at the same time I'm reading, I'm compressing and sending it. Then I wanna know if HttpResponse.Filter do the same thing, or otherwise it will load the whole file in memory in order to compress it. Also, I'm a little bit insecure about this... maybe is needed to load the whole file in memory to compress it... is it?

View 1 Replies

Configuration :: Process.start (System.Diagnostics.Process) - Execute A Batch File

Sep 7, 2010

I've written a aspx.net(C#) page that after the user has done what they do on the page they hit a Submit button. The Submit button

1) takes the work the users was producing on the page and writes it to a file.
2) attempts to execute a batch file.

The call to the batch file is executed via:

protected void Execute123EDI()
{
try
{
string File = @"c:80sAdminSendV80s.bat";
lblCancelled.Text = lblCancelled.Text + File;
Process proc = new System.Diagnostics.Process();
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.LoadUserProfile = false;
proc.StartInfo.UserName = "administrator";
proc.StartInfo.RedirectStandardOutput = true;
System.Security.SecureString secPass = new System.Security.SecureString();
string paswd = "123abc";
for (int i = 0; i < paswd.Length; i++)
{
secPass.AppendChar(paswd[i]);
}
proc.StartInfo.Password = secPass;
proc.StartInfo.FileName = File;
proc.Start();
FileStream fs = new FileStream(@"c:80sAdminSendV80sOutput.log", FileMode.Append);
StreamWriter sw = new StreamWriter(fs);
sw.Write(proc.StandardOutput.ReadToEnd());
proc.WaitForExit();
sw.Close();
proc.Close();
}
catch(Exception ex)
{
lblDebug.Text = lblDebug.Text + ex.Message + "<br/>";
}

If I watch the processes tab in Task Manager on the web server I see "cmd.exe" under the context of 'administrator' but it just hangs. For test purposes c:SendV80s.bat: copy c: oot.ini c:zzz.txt

If I logon onto the webserver's console and execute SendV80s.bat it works and exits without issue. But when I execute the same batch file via the Submit button it gets stuck executing in Task Manager/Process. I believe this has something to do with the fact that cmd is not running in a full environment/desktop context. I just noticed this on the actual console of the webserver (not in my RDP console but console 0 instead)

A pop-up box stating: CMD.exe Application error The application failed to initialize properly (0xc0000142). Click OK to terminate the application. And when I click on the OK button my ASPX page's WaitForExit is satisfied and the continues processing normally.

View 2 Replies

Long Running HTTP Process - How To Put In Separate Process

Jul 21, 2010

I know that similar questions have been asked all over the place, but I'm having trouble finding one that relates directly to what I'm after.

I have a website where a user uploads a data file, then that file is transformed and imported into SQL. The file could be up to 50mb in size, and some times this process can take 30 minutes or sometimes even longer.

I realise I need to palm off the actual work to another process, and poll that process on the web page. I'm wondering what the best approach would be though? Being a web developer by trade, I'm finding all this new Windows Service stuff a bit confusing, and I just wanted somewhere to start.

So:

Can I do / should I being doing this with a windows service? if so, how?

Should I use WCF? If this runs under IIS, will I have problems with aspnet_wp.exe recycling and timing out my process?

clarifications

The data is imported into sql, there's no file distribution taking place.

If there is a failure, it absolutely MUST be reported to the user. The web page will poll every, lets say, 5 seconds, from the time the async task begins, to get the 'status' of the import. Once it's finished another response will tell the page to stop polling for status updates.

queries on final decision

ok, so as I thought, it seems that a windows service is the best idea. So as to HOW to get it to work, it seems the 'put the file there and wait for the service to pick it up' idea is the generally accepted way, is there a way I can start a process run by the service, without it having to constantly be checking a database table / folder? As I said earlier, I don't have any experience with Windows Services - I wondered if I put a public method in the service, can I call it somehow?

View 2 Replies

Execute A Process Remotely With System.Diagnostics.Process

Feb 26, 2010

I'm working on an ASP.net app I'm trying to execute a process remotely , using System.Diagnostics.Process class here's my code:

ProcessStartInfo startInfo = new ProcessStartInfo(@"C:TestCommand.exe");
startInfo.Domain = "myDomain";
startInfo.UserName = "MyUserName";
SecureString sec = new SecureString();
foreach (char item in "MyPassword")
{
sec.AppendChar(item);
}
sec.MakeReadOnly();
startInfo.Password = sec;
startInfo.UseShellExecute = false;
Process.Start(startInfo);

I keep receiving an exception with the message "Logon failure: unknown user name or bad password". Im absolutelly sure that i'm submiting my correct username/pwd

View 1 Replies

Web Forms :: The Process Cannot Access The File 'c: Empmy.pdf' Because It Is Being Used By Another Process?

Apr 3, 2010

I've developed a popup email .aspx used on our intranet based web app that is auto generated with .pdf's attached. I'm developing with VS 2008 ASP.Net 3.5 C# and System.Net.Mail.MailMessage. I can create and send the email with no issues. The problem is with any attempt to open or delete the attachments I get the above error. The .pdf's a copied with the following code:

FileStream fsr = new FileStream(inFilename, FileMode.Open, FileAccess.Read, FileShare.Read);
BinaryReader reader = new BinaryReader(fsr);
byte[] bytes = new byte[fsr.Length];
reader.Read(bytes, 0, bytes.Length);
FileStream fsw = new FileStream(outFileName, FileMode.Create, FileAccess.Write, FileShare.Write);
BinaryWriter writer = new BinaryWriter(fsw);
writer.Write(bytes, 0, bytes.Length);
// clean up
writer.Flush();
writer.Close();
writer = null;
fsw.Close();
fsw.Dispose();
fsw = null;
reader.Close();
reader = null;
fsr.Close();
fsr.Dispose();
fsr = null;
Later after sending the email I:
mailMessage.Dispose();
mailMessage = null;
foreach (string fileName in attachments)
{
if (File.Exists(fileName))
File.Delete(fileName);
}

The error occurs at: the File.Delete(fileName);

how I can delete or reopen these files after sending the email?

View 9 Replies

How To Recognize Whether The Process Is The IIS Worker Process From Within A .NET Code

Dec 25, 2010

Dear ladies and sirs.

I have a .NET infra code running both within the IIS worker process and within a desktop client app. How can the .NET code determine whether it is running within an IIS worker process?

I know that I could check the name of the process (w3wp.exe, for instance), but I would like a more robust approach. I wish to make a side note. This is not a production need. I need this information to enable certain scenarios useful during the development and testing phase. Specifically to ease the testing of secure vs non secure configurations.

View 3 Replies







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