...

View Full Version : Concurrency violation



foxxxx
01-11-2012, 04:07 AM
Hello!

I write on MySQL 5.5, C#, ADO.NET, DataSet. I have a DataSet and DataAdapter filled it. In DataAdapter I override INSERT, UPDATE, DELETE commands. When I use stored procedures, as these commands, all is well. However, when I use transactionns in this stored procedures, I get an exception: "Concurrency violation: the DeleteCommand affected 0 of the expected 1 records."

Can you please tell me what to do, and what common solutions to my problem there?

Sample code and DB dump:

http://dl.dropbox.com/u/46828938/DataGridSample.zip

To reproduce the problem: Delete row from Datagrid and press "Update" button.

DBConcurrencyException ("Concurrency violation: the DeleteCommand affected 0 of the expected 1 records.") reproduce on:"productDataAdapter.Update(dataSet, "Products");" string.

Best regards!

XmisterIS
01-11-2012, 12:18 PM
Without delving into your code, are you familiar with IS_FREE_LOCK and GET_LOCK?

foxxxx
01-22-2012, 02:12 PM
I agree with the ideas offered by and understand:

1. That lock's can not used in in stored procedures.
2. I instead used lock's I attempted change isolation levels (on SERIALIZABLE) - did not help.
3. My example is a single-user: it works on one machine / run one instance.

Can you please tell me: "what to do and where to go in the future"?

foxxxx
01-27-2012, 08:43 AM
Any answers? :)

foxxxx
01-31-2012, 08:06 AM
Question is still relevant, as you could comment on that? :)

foxxxx
02-02-2012, 06:49 AM
Any voices on my question?:)

Old Pedant
02-03-2012, 04:02 AM
I think you are going to need to get some ASP.NET experts in on this, and there aren't many here. Better off posting in the forums a www.asp.net more than likely.

foxxxx
02-08-2012, 06:07 AM
I think you are going to need to get some ASP.NET experts in on this, and there aren't many here. Better off posting in the forums a www.asp.net more than likely.

Thank you for your reply.
This question I asked on Microsoft's forum:
http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/7f7f8cc8-fd34-452b-8206-f771fffd67cc
There I was advised to go to your forum.

In addition, I searched the forums mysql and found a similar problem:
http://forums.mysql.com/read.php?98,187617,187617

In connection with the above, I want to know what typical patterns of solutions to this problem exist?

Best regards!

foxxxx
02-14-2012, 05:06 AM
any answers? :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum