none
Concurrency and deleted rows RRS feed

  • Question

  • Hi, 

     My concurency scenario is like this:
    - User1 load a entity and makes some modifications.
    - In the mean time User2 deletes the same entity User1 is editing.
    - User1 tries to commit a ChangeConflictException is thrown.

     I want to warn User1 that his entity was deleted and restore the entity.

     My first try was:

     foreach (ObjectChangeConflict occ in MyDataContext.ChangeConflicts)
    {
    occ.Resolve(RefreshMode.KeepCurrentValues);
    }
    MyDataContext.SubmitChanges()

    But this does not seem to work.
    Any ideas ?

    Thank you,

    "ME: How do I achive the imposible !" "The Wise Man: With entusiams !"
    Wednesday, February 11, 2009 8:45 AM