Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Concurrency violation

    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!

  • #2
    Regular Coder
    Join Date
    Jun 2010
    Posts
    293
    Thanks
    63
    Thanked 8 Times in 8 Posts
    Without delving into your code, are you familiar with IS_FREE_LOCK and GET_LOCK?

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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"?

  • #4
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Any answers?

  • #5
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Question is still relevant, as you could comment on that?

  • #6
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Any voices on my question?

  • #7
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,184
    Thanks
    75
    Thanked 4,339 Times in 4,305 Posts
    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.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    foxxxx (02-08-2012)

  • #8
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Old Pedant View Post
    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/For...6-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!

  • #9
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    any answers?


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •