Re: Performance comparison on Update vs. UpdateBatch - record by record

From: Anushi \(Grapecity\) (anonymous_at_discussions.com)
Date: 10/29/04


Date: Fri, 29 Oct 2004 18:05:44 +0530

Hi Jiho,

As quoted by an MVP...Update updates current record in recordset, in case if
you have changes in
that recordset. UpdateBatch provides updating of multiple records in
database in one shot. In case if
you have edited current record, then UpdateBatch first calls Update and then
send changes from all changed
records to the database. It is usefull feature in case if your recordset is
disconnected from database, you make some chages in recordset, reconnect it
back to database and call UpdateBatch. In that case all changes from
recordset will be applied against database in one shot, which improves
performance of updating. But you should be aware, that not all providers
support UpdateBatch feature and it could have some limitations in each
particular case.
When dealing with batch updates you have to think about the scenario that
one user will change a record before changes made by another user editing
the same record are saved. So you have to take care of detecting and
resolving conflicts.
Additional reference :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdcondetectresolveconflicts.asp

HTH,
Anushi

"Jiho Han" <jhan@infinityinfo.com> wrote in message
news:uOdehZPvEHA.1300@TK2MSFTNGP14.phx.gbl...
> I was wondering if there are any significant performance difference
between using Update vs. UpdateBatch (adLockOptimistic vs.
adLockBatchOptimistic).
>
> I don't mean to batch up changes and call UpdateBatch. I would be calling
UpdateBatch on every record change basically.
> I know I could simply use Update in this case but that's not the point.
>
> Thanks much.
> Jiho



Relevant Pages

  • UpdateBatch or Update w/Stored Procedure (Database via Wireless Network)
    ... Server 2000 database. ... across the wireless network while the stored procedure is executed. ... performance hit at the closing of a form by doing UpdateBatch via ADO, ...
    (microsoft.public.vb.database.ado)
  • Re: ADO UpdateBatch Problems
    ... >in batch update mode with an optimistic locking strategy, sitting on top of ... >errors where two people are editing the same record - calls to UpdateBatch ... I just did a quick test of this using the NorthWind sample database ...
    (borland.public.delphi.database.ado)
  • Re: Updates not applied when using cloned datasets
    ... Then execute the UpdateBatch and then reconnect the detail to the master. ... I have three TADODatasets, DsetHeadings is a master ... > UpdateBatch will not work (no changes sent to the database) on ...
    (borland.public.delphi.database.ado)
  • Re: Stale Data
    ... Do you re-connect your recordset to the database before calling UpdateBatch? ... > thus how i can make sure that i try to delete the stale data ...
    (microsoft.public.data.ado)