DataAdapter.Update - batch or round trips?

  • Thread starter Thread starter Andrew Stephen
  • Start date Start date
A

Andrew Stephen

Hi - I've seen several clues to this but I wonder if any experts can
definitively confirm ......

Does the DataAdapter.Update method pass all updated datarows to the
database for some kind of batch process with multiple calls to the
update command but only one open and close of the connection, or does
it do multiple round trips to the database and multiple connection
open/closes, one for each updated datarow?
(My specific interest is in the OracleDataAdapter but I'm guessing the
answer applies to all DB providers).

Thanks for any responses.
 
Andrew Stephen said:
Hi - I've seen several clues to this but I wonder if any experts can
definitively confirm ......

Does the DataAdapter.Update method pass all updated datarows to the
database for some kind of batch process with multiple calls to the
update command but only one open and close of the connection, or does
it do multiple round trips to the database and multiple connection
open/closes, one for each updated datarow?
(My specific interest is in the OracleDataAdapter but I'm guessing the
answer applies to all DB providers).

Thanks for any responses.

This is how the DataAdapter works with the connection (according to my
understanding):

If the DataAdapter finds a closed connection, it opens it, runs all the
commands it deems necessary, and finally closes the connection. It does not
call open and close for each command.

If the DataAdapter finds a connection already open, it runs all the commands
it deems necessary, and leaves the connection open.

Erik
 
Erik Frey said:
This is how the DataAdapter works with the connection (according to my
understanding):

If the DataAdapter finds a closed connection, it opens it, runs all the
commands it deems necessary, and finally closes the connection. It does not
call open and close for each command.

If the DataAdapter finds a connection already open, it runs all the commands
it deems necessary, and leaves the connection open.

Yup - however, it doesn't actually batch together the
updates/inserts/whatever. I believe this is coming in V2.0 of ADO.NET
though.
 
Back
Top