Concurrency Question

Last post 05-14-2008 12:04 PM by scothu. 1 replies.

Sort Posts:

  • Concurrency Question

    05-14-2008, 10:45 AM
    • Loading...
    • tlanier
    • Joined on 04-29-2008, 1:20 PM
    • Posts 67

    If I try to update a record and while I'm editing the record it is changed by something else, I get this error displayed:

    A Runtime Error has occurred.
    Do you wish to Debug?

    Line: 4698
    Error: Sys.WebForms.PageRequestManagerServerErrorException: Row not found or changed.

    Note that I have not upgraded this computer to the 5/12 build.

    Is there a way for us to control the error message that the user sees?

    Is there a way for us to resolve the concurrency conflict?

    In Joseph Rattz's book "Pro LINQ" in chapter 17 he talks about how to resolve concurrency conflicts.

    "Resolving conflicts gets no easier than this. You merely catch the ChangeConflictException and call the ResolveAll method on the DataContext.ChangeConflicts collection. All you have to do is decide which RefreshMode to use and if you want to automatically resolve deleted records."

    Is Dynamic Data already doing something like this, or is it up to us to do it?

    Thanks,

    Tommy

  • Re: Concurrency Question

    05-14-2008, 12:04 PM
    • Loading...
    • scothu
    • Joined on 12-10-2007, 1:54 AM
    • Redmond, WA
    • Posts 109
    • AspNetTeam

    Dynamic Data does not try to handle any database errors, we leave those up to you to handle still. If you can handle them in a generic way you can modify the page templates which exist in DynamicData/PageTemplates. If you want to handle a special case for a particular table you can do the following. In my example the table I want to customize is the Products table in Northwind. In the DynamicData/CustomPages directory create a new directory called Products. From the DynamicData/PageTemplates copy the Edit.aspx file into the new directory you created. Now you have a custom page just for editing on that one table that you can customize.

    Scott Hunter
    ASP.NET
Page 1 of 1 (2 items)