Usage of DbDataAdapter.Update Method

Usage of DbDataAdapter.Update Method

Postby richardho » Thu 05 Feb 2015 15:28

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
richardho
 
Posts: 8
Joined: Fri 30 Jan 2015 04:26

Re: Usage of DbDataAdapter.Update Method

Postby Pinturiccio » Mon 09 Feb 2015 16:13

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/universal/docs/Devart.Data~Devart.Common.DbCommandBase~CommandTimeout.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.
Pinturiccio
Devart Team
 
Posts: 1982
Joined: Wed 02 Nov 2011 09:44

Re: Usage of DbDataAdapter.Update Method

Postby richardho » Mon 09 Feb 2015 16:54

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
richardho
 
Posts: 8
Joined: Fri 30 Jan 2015 04:26


Return to dotConnect Universal