locked
Problem with the commandbuilder in the MySQL connector and concurrency violations RRS feed

  • Question

  • User-232858378 posted
    I'm having a weird problem with concurrency violations in an application. Particularly when I run the DataAdapter.Update(DataSet) command; I don't think it is a problem with my code specifically. It might be a problem with the database itself, but I doubt it. What's happening is that the Commandbuilder's update command is using the NEW data values in the where portion of the Update instead of the OLD values. Hence, it is returning no rows to update. (and, thus, a concurrency violation) To make matters even weirder, if I backup the database and restore it on my development machine, it works perfectly. AND, if I back it up and restore it on the machine originally with the problem, it also works perfectly. (in fact, I can no longer replicate the problem with that particular record because of this) The biggest problem is that it's happened more than once in our pre-release testing. I can't seem to cause it, but another tester has (by accident) a couple of times. I'm a little worried about this. I could just manually rewrite the Update query to only query for the unique record in the WHERE portion of it (instead of using the Command builder), but I really don't want to. In examining the query logs, the only difference is that in the working one, the update sets 'Status' = 'Submitted' and then the WHERE contains 'Status' <=> 'Not Submitted' and the non-working one is 'Status' = 'Submitted' and the WHERE contains 'Status' <=> 'Submitted' Note that, in the database, 'Status' is previously set to 'Not Submitted' The problem here seems to be with the command builder, but it goes away under the exact same conditions. Is this really a problem with the database or maybe some other problem with MySQL connector populating the dataset? I would post code, etc. about it, but I don't think it's a problem with me code. I just want to know if anyone else has had this problem, and, if so, whether or not they discovered it's cause. Thanks
    Thursday, May 25, 2006 1:54 PM

All replies

  • User1589091795 posted

    Hi,

    I'm having exactly the same problem, haven't figured out whats causing this...

    Sunday, July 3, 2011 3:09 PM