OracleDataTable - Asynchronously - BeginFill EndFill Usage

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby Pinturiccio » Fri 06 Oct 2017 12:07

Please comment the following line in the CreateOracleDataset method:
Code: Select all
oracleDataTable.MissingSchemaAction = MissingSchemaAction.Add;

By default MissingSchemaAction equals to AddWithKey. With AddWithKey the issue should not occur again.
Pinturiccio
Devart Team
 
Posts: 1997
Joined: Wed 02 Nov 2011 09:44

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Sat 07 Oct 2017 16:04

Ok, Thanks for your answer,I going to try it, and will let you know something if is the case.
lewis
 
Posts: 21
Joined: Thu 13 Sep 2012 15:59

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Sat 07 Oct 2017 16:57

Hi,sr I commented the code according with you told, however the same behaviour persists, I sent the link with a word file with pictures showing the results, including the same project with the modification you suggested, could yo please try it, thanks in advance:

https://1drv.ms/w/s!Ap7GLUK36zn2kX7PFGKbihd2GzO-
lewis
 
Posts: 21
Joined: Thu 13 Sep 2012 15:59

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby Pinturiccio » Wed 11 Oct 2017 13:28

Please send us the changed project, results of which are displayed on https://1drv.ms/w/s!Ap7GLUK36zn2kX7PFGKbihd2GzO-

Please send it to the following email support at devart dot com or via contact form. If your project has a size of several megabytes or more, you can archive your project and upload it to our ftp server (ftp://ftp.devart.com, credentials: anonymous/anonymous ) or to any file exchange server so that we could download it from there. You can send us the password to the archive via our contact form.
Pinturiccio
Devart Team
 
Posts: 1997
Joined: Wed 02 Nov 2011 09:44

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Wed 11 Oct 2017 21:21

Hi, this is the link for the modified project https://1drv.ms/u/s!Ap7GLUK36zn2kX9UtsrqeXxkuDjF

Thanks in advance
lewis
 
Posts: 21
Joined: Thu 13 Sep 2012 15:59

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby Pinturiccio » Wed 18 Oct 2017 11:49

Could you please provide the DDL script of your table? Looks like there is no primary key in your table. We have reproduced the described behavior when there is no primary key in a table.

Please also note that you use the following code in the OperationComplete and btnNextAsyn_Click operations:
Code: Select all
oracleDataTable.CancelFetch();

CancelFetch cancels the asynchronous fetching, and you cannot continue fetching after this, unlike the SuspendFill method. For more information, please refer to https://www.devart.com/dotconnect/oracle/docs/?Devart.Data~Devart.Common.DbDataTable~CancelFetch.html

Thus, your code does the following:
1. After you click BeginFill, suppose, 110 records are read.
2. After this, OperationComplete is called, which calls CancelFetch for the DataTable. Then asynchronous fetching stops.
3. Then you click Next Asyn, and some more rows are read. Suppose, it is 100 rows. Fetching is done from scratch, because the first async operation was finished.
4. If there is no primary key in the table, these first 100 rows are added to your 110 rows again. And so on with each Next Asyn button click.
5. If the table has a primary key, these 100 rows won't be added to the table, because such PK values are already present.

We advise you to replace CancelFetch calls with SuspendFill calls, and use a table with a primary key. If there is no primary key in the table, even with SuspendFill calls, the following situation may happen: at some moment, Next Asyn will finish async fetching after reading all the table rows. But the next Next Asyn button click will restart it, and read more rows from the beginning of the table.
Pinturiccio
Devart Team
 
Posts: 1997
Joined: Wed 02 Nov 2011 09:44

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Wed 18 Oct 2017 15:01

in my case, i just execute a simple select * from user_objects in this case i think i dont have a primary available, i know that "Next Asyn will finish async fetching after reading all the table rows. But the next Next Asyn button click will restart it, and read more rows from the beginning of the table" but i don't know how to avoid to user press the "Next Asyn" button again. if i change the "Next Asyn" logic calling a

int i = Fillpage(start, number of records)

https://www.devart.com/dotconnect/mysql/docs/Devart.Data~Devart.Common.DbDataTable~FillPage.html

i can do that, because Fillpage returns the number of records fectched, so if i =0 i know the finish has been reached but right now is no posible, the problem with Fillpage method is slow. How i can do that?
lewis
 
Posts: 21
Joined: Thu 13 Sep 2012 15:59

Previous

Return to dotConnect for Oracle