Page 1 of 1

Usage of DbDataAdapter.Update Method

Posted: Thu 05 Feb 2015 15:28
by richardho
Dear Sir/Madam,

I am planning to use DbDataAdapter.Update method of dotConnect Universal Professional to post the changes of DataTable to Oracle Database. But I do not know how sophisticated/well the DbDataAdapter.Update to handle the batch updates of DataRow/DataTable back to the Oracle database.

For example, if I need to update 10 DataRows back to the Oracle table for which 2 records in the Oracle table are currently locked by other application. How DbDataAdapter.Update reacts these two locked records from the Database? Will 8 out of 10 DataRows be updated back to the Database and failed 2, without any notification?

Would you please give me some idea or advice.

Many thanks
Richard Ho

Re: Usage of DbDataAdapter.Update Method

Posted: Mon 09 Feb 2015 16:13
by Pinturiccio
richardho wrote:For example, if I need to update 10 DataRows back to the Oracle table for which 2 records in the Oracle table are currently locked by other application.
The Update method of the UniDataAdapter class updates rows until it reaches the locked row. After this the method waits for this row to be unlocked. The previous rows are already updated and submitted to the database.

If UniCommand has CommandTimeout is not equal to zero, then, after reaching the specified limit while waiting for the locked row, an exception is raised. For more information, please refer to http://www.devart.com/dotconnect/univer ... meout.html

You can use UniTransaction and perform the Update method of the UniDataAdapter class within a transaction. In such case you will have either all rows updated or no rows updated.

Re: Usage of DbDataAdapter.Update Method

Posted: Mon 09 Feb 2015 16:54
by richardho
Thanks Pinturiccio,

This is a professsional feedback on my enquiry. Though it is a common scenario of locking machanism for muilti-user environment. But you gave me the full picture of how dotConnect Universal handles this case.

Best Regards
Richard Ho