Results 1 to 3 of 3

Thread: Concurrency Violation

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    7

    Concurrency Violation

    I get a "Concurrency Violation - UpdateCommand affected 0 records" when i update a Dataset twice or more. (Im working in deconnected mode)

    The first time, everything is fine, second time i get the error.

    If i refill my dataset with the DataAdapter after every save, everything is fine. But i want to reduce the access to database time, so i dont want to reload my dataset each time i do an update ! It is possible to avoid that ?

    Im using VB .NET 2003 with Oracle 9I database.

    Thank for your help !

    Sebastien

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Concurrency Violation

    I would say that a Concurrency violation is much worse than the delay to re-access the data (which is probably why the error is there).

    The trouble is that you are writing data which somebody else might try to read/update (or you may be trying to edit data which somebody else has already updated). This means that two people could both update the same data, and one of their edits will be lost without warning.


    You may be able to change the locking mode of the dataset/DataAdapter (I've got no idea how, I havent used them yet) so that you have exclusive access to the data - in which case the error messages may go.


    Alternatively limit the data you return to fewer records, so that it can load more quickly. This also has the bonus of reducing locking issues.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Concurrency Violation

    Don't crosspost your question. You'll end up with half answers which don't match.

Posting Permissions

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



Click Here to Expand Forum to Full Width