none
Concurrency Not Detected RRS feed

Answers

  • Hi,

    What is the datatype of the the column you are updating ? Also you don't just update this column with the same value ?

    Your best bet is likely to trace the SQL statements sent to your server. Basically it uses a WHERE clause with the original values of the columns. As a result, no row is found if one of the column value has been changed in between. Another option is likely to use a rowversion column (this way the same can be done by testing a single column rather than numerous columns). So looking at the WHERE clause would be first step to see if it tries at all to handle concurrency...

     


    Please always mark whatever response solved your issue so that the thread is properly marked as "Answered".
    Tuesday, October 18, 2011 1:09 PM
  • Hi Minesh,

    I would have to see your exact example to see what you're trying to do, the tutorial in your link is really demonstrating how to turn off change tracking, nothing to do with the actual optimistic concurrency checking and subsequent errors.

    Below is a link that better shows how the DbUpdateConcurrencyException would be raised:

    http://blogs.msdn.com/b/adonet/archive/2011/02/03/using-dbcontext-in-ef-feature-ctp5-part-9-optimistic-concurrency-patterns.aspx


    Tom Overton
    Tuesday, October 18, 2011 1:59 PM

All replies

  • Hi,

    What is the datatype of the the column you are updating ? Also you don't just update this column with the same value ?

    Your best bet is likely to trace the SQL statements sent to your server. Basically it uses a WHERE clause with the original values of the columns. As a result, no row is found if one of the column value has been changed in between. Another option is likely to use a rowversion column (this way the same can be done by testing a single column rather than numerous columns). So looking at the WHERE clause would be first step to see if it tries at all to handle concurrency...

     


    Please always mark whatever response solved your issue so that the thread is properly marked as "Answered".
    Tuesday, October 18, 2011 1:09 PM
  • Hi Minesh,

    I would have to see your exact example to see what you're trying to do, the tutorial in your link is really demonstrating how to turn off change tracking, nothing to do with the actual optimistic concurrency checking and subsequent errors.

    Below is a link that better shows how the DbUpdateConcurrencyException would be raised:

    http://blogs.msdn.com/b/adonet/archive/2011/02/03/using-dbcontext-in-ef-feature-ctp5-part-9-optimistic-concurrency-patterns.aspx


    Tom Overton
    Tuesday, October 18, 2011 1:59 PM
  • Hi,

    I am writing to check the status of the issue on your side. Would you mind letting us know the result of the suggestions?

    If you need further assistance, please feel free to let me know. I will be more than happy to be of assistance.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, October 24, 2011 1:54 AM
    Moderator
  • I have problem I cannot get DbUpdateConcurrencyException to fire even though my Rowversions are different also there is no where clause for the stamp
    Thursday, February 11, 2016 1:51 PM
  • Please start a new thread and include enough information to understand and reproduce the issue you are having.

    David


    David http://blogs.msdn.com/b/dbrowne/

    Thursday, February 11, 2016 2:37 PM