I have a question as to whether a database will be able to 'handle' a piece of code (it is a MySQL database i.e. client-server model). The pseudocode:
foreach clientSo, as it iterates through the clients, a simple UPDATE command is executed for each client. My question is, will there be any performance issue with this? Does the database need any kind of break in time between each UPDATE command, or can it handle being bombarded with the UPDATE statements at the high speed of the foreach loop?
update database with client details;
My guess is that it can handle it, but I need to be sure and I don't have enough sample data to really test it. I am hoping this is an obvious question which someone can easily confirm, based on their experience.
Thanks
DavePosted Dec 28, 2007, 9:40 PM
Each update uses a IDBCommand. So long as the connection is not specified to be asynchronous, each ExecuteNonQuery() will be synchronous. Therefore, each command will complete before moving on to the next iteration. Therefore, there will be no issue of the database becoming "out of synch" with the loop on the GUI side.