Manual Update rather than UpdateBatch when underlying data substantially changed

From: Dave Blake (barnswood_at_hotmail.com)
Date: 02/21/05

  • Next message: Stefan Olofsson: "How to terminate a query"
    Date: Mon, 21 Feb 2005 10:56:06 -0000
    
    

    I have a clientside cursor, batchoptimistic locked dataset with updates
    pending but the internal sequence of SQL updates that calling UpdateBatch
    would implement will encounter write conflicts and key-violations etc. and
    fail as the underlying data has substantially changed. However I simply want
    to replace the data at the server with that cached local data regardless.
    How do I do that?

    To explain more fully:

    I am using batchoptimistic locking and clientside cursors to make edits to
    data in a master details relationship. The mdb file has RI defined to
    cascade both deletes and updates from master table to details table.
    Sometimes Master records are deleted and the remaining record IDs renumbered
    (no gaps), which means that some details records are deleted the partial key
    of others is updated. This may seem odd, but I have reasons to want it like
    that.

    Of course the local cached datasets do not benefit from the RI rules, hence
    locally (while user making changes but not saved them to server) the
    deletion and renumbering has to be done explicitly. This is not a problem,
    but I have found that when finally doing the batch updates the RI causes
    write conflicts. Not a surprise really, when master.updatebatch called the
    RI cascades changes to the details table, then when details.updatebatch is
    called with all the details deleted or partial key values changed it finds
    the underlying data has changed.

    So when deletion and renumbering has happened rather than call
    details.updatebatch and try and untangle the conflicts with the cascaded
    changes, I thought one solution would be to do the updates manually. That is
    delete all the affected details at the server and re-populate it with the
    records held cached in the local dataset. How can I most easily do this? Do
    I loop through the dataset creating a SQL insert statement to execute, or is
    there some clever ADO method I can use?

    I hope someone can understand what I am getting at.

    Dave


  • Next message: Stefan Olofsson: "How to terminate a query"

    Relevant Pages

    • Re: Unable to retain password for Outlook/ Express
      ... not done the service pak updates. ... software conflicts) they may charge you for fixing the ... Microsoft claims that since the XP ... >responsibility to take care of the problem. ...
      (microsoft.public.windowsxp.security_admin)
    • Re: too many slow computer complaints
      ... that the extra services really slow down my machine, so like to turn off the ... are not aware of and a lot of it probably causes conflicts. ... seven years old and I don't think it can handle the current updates. ...
      (microsoft.public.windowsxp.help_and_support)
    • Re: too many slow computer complaints
      ... aware of and a lot of it probably causes conflicts. ... a conflict with my ISP's firewall/security program and my HP printer. ... think it can handle the current updates. ... memory will help some, but an old processor, motherboard, hard drive, etc. ...
      (microsoft.public.windowsxp.help_and_support)
    • Re: too many slow computer complaints
      ... that we are not aware of and a lot of it probably causes conflicts. ... handle the current updates. ... at their local big-name electronics store or because there is a sale. ... protect your data, yourself and better enjoy your time using an electronic ...
      (microsoft.public.windowsxp.help_and_support)
    • SP1 Install
      ... I did a fresh build and while at it installed the updates downloaded from ... Do I need to run the MSDE & SQL Updates now that I've installed SP1? ...
      (microsoft.public.windows.server.sbs)