OracleDataTable - Asynchronously - BeginFill EndFill Usage

OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Thu 02 May 2013 17:48

Hi, could you please supply me with a Sample working code where can i see the right usage of fetching data asynchronously from database using OracleDataTable?, i have studied all information related that is available (OracleDataTable Advanced Features) and so on, but i couldn't get to work it, i would you use BeginFill,EndFill, CancelFetch etc. when i want.

I wrote the code below, but there is no records fectched when i got the result :

myResult = (AsynResult)this.oracleDataTable.BeginFill(new AsynCallBack(OperationComplete),this.oracleDatable);

thanks
lewis
 
Posts: 23
Joined: Thu 13 Sep 2012 15:59

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Thu 02 May 2013 18:56

Also i noticed that :

oracleDataTable.Rows.Count = 0
oracleDataTable.Columns.Count = 12;

meaning that Columns definitions were loaded but data don't.
lewis
 
Posts: 23
Joined: Thu 13 Sep 2012 15:59

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Fri 03 May 2013 12:53

Hi, finnally i got to the code below :

myDataTable.Connection = myConnection;
myDataTable.SelectCommand = myConnection.CreateCommand();
myDataTable.SelectCommand.CommandText = "SELECT * FROM Dept";

IAsyncResult aRes = myDataTable.BeginFill(null, null);

Console.Write("Fetch in process");

Thread.Sleep(100);
myDataTable.SuspendFill(true);
Console.Write("Fetch is stopped");

myDataTable.EndFill(aRes);
Console.Write("All records are fetched");

I fetched the data and show it in DataGriview by setting the Datasource property, however the fetching proccess only retrieve 5 records automaticatly, how can increase the nummber of records fetched at once.

Thanks in advance for your help.
lewis
 
Posts: 23
Joined: Thu 13 Sep 2012 15:59

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby Pinturiccio » Fri 10 May 2013 12:50

We are investigating the issue and will notify you about the results as soon as possible.
Pinturiccio
Devart Team
 
Posts: 2021
Joined: Wed 02 Nov 2011 09:44

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby Pinturiccio » Wed 15 May 2013 14:46

lewis wrote:how can increase the nummber of records fetched at once.

The number of records fetched at once during Asynchronous BeginFill execution can't be set. Asynchronous Fetch is not designed for this. If you want to control the number of records fetched at once, you should use Sequential Fetch Mode or Paginal Fetch Mode
Pinturiccio
Devart Team
 
Posts: 2021
Joined: Wed 02 Nov 2011 09:44

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Mon 17 Jul 2017 21:04

After many tries ,finally i got to make the code you suggest works, I call the beginFill method many times and my grid is populate with next group o records as expected

IAsyncResult aRes = myDataTable.BeginFill(null, null);
Thead.Sleep(500);

but the problem i have right now is, how I get to know that there are no more records to fetch from database. As a example i have a table with 240 records. so :

-the first BeginFill fetchs 100 records.
-the second BeginFill fetths 200 records.
-I expected the next BeginFill will fecth 40 records but instead it fecths 100 more, it seems like Begin start again the fecth from the beginning, i could to know if all completed records are fetching i can disable the subsequents BeginFills.
-On the other side somethings the queried table has no much records, so only one BeginFill is enough so i need to avoid user call the next beginFill (Button disable), but have no something in order compare values: RecordCount.

QueryRecordCount is very expensive to use in Large Data Tables.
synchronous FillPage tells me at least how many records fetched.

Thanks in advance for your help
lewis
 
Posts: 23
Joined: Thu 13 Sep 2012 15:59

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby Pinturiccio » Mon 24 Jul 2017 11:25

Please create and send us a complete small test project with corresponding DDL/DML scripts that reproduce the issue and describe the steps we should follow in order to reproduce the issue.

Please also describe the behavior you expect on each step, and the behavior you get.
Pinturiccio
Devart Team
 
Posts: 2021
Joined: Wed 02 Nov 2011 09:44

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Mon 24 Jul 2017 12:49

Ok , please give time in order to prepare the demo. thanks for your answer.
lewis
 
Posts: 23
Joined: Thu 13 Sep 2012 15:59

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Tue 22 Aug 2017 19:26

hi,I've just sent the Demo application, i'm sorry for the delay
lewis
 
Posts: 23
Joined: Thu 13 Sep 2012 15:59

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby Pinturiccio » Mon 28 Aug 2017 14:55

We did not receive a demo project. 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: 2021
Joined: Wed 02 Nov 2011 09:44

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Mon 04 Sep 2017 20:11

this is the link for the demo project :https://1drv.ms/u/s!Ap7GLUK36zn2kXVN_oKTfzrmpVM8
thanks advance, please tell us when you got the file, thanks in advance
lewis
 
Posts: 23
Joined: Thu 13 Sep 2012 15:59

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby Shalex » Tue 12 Sep 2017 10:00

Thank you for the test project. We are processing your request.
Shalex
Devart Team
 
Posts: 7777
Joined: Thu 14 Aug 2008 12:44

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby Shalex » Fri 29 Sep 2017 11:06

lewis, if I ran your code against a table with 240 records, it fetched all 240 records at once when pressing the BeginFil button.

You are using Asynchronous BeginFill in your project.

Please review Pinturiccio's answer:
"The number of records fetched at once during Asynchronous BeginFill execution can't be set. Asynchronous Fetch is not designed for this. If you want to control the number of records fetched at once, you should use Sequential Fetch Mode or Paginal Fetch Mode."

Taking into account this information, please specify:
1) the problem you have encountered (the expected behavior and the actual one)
2) the exact steps we should follow with your project to reproduce the issue
Shalex
Devart Team
 
Posts: 7777
Joined: Thu 14 Aug 2008 12:44

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Mon 02 Oct 2017 18:17

My problem is :

how I get to know that there are no more records to fetch from database. As a example i have a table with 240 records. so :

-the first BeginFill fetchs 100 records. -- is ok
-the second BeginFill fetths 200 records. --is ok
-I expected the next BeginFill will fecth 40 records but instead it fecths 100 more, it seems like Begin start again the fecth from the beginning, i could to know if all completed records are fetching i can disable the subsequents BeginFills.
-On the other side somethings the queried table has no much records, so only one BeginFill is enough so i need to avoid user call the next beginFill (Button disable), but have no something in order compare values: RecordCount.

QueryRecordCount is very expensive to use in Large Data Tables.
synchronous FillPage tells me at least how many records fetched.

There is something curios, If i use the grid scroll down, the grid fills gradually with the records and when if it got the end of records (240), grids stops and it is ok.

If i am Fillpage it works well because it knows how many records fechted but it its very slow.

Thanks in advance for your help
lewis
 
Posts: 23
Joined: Thu 13 Sep 2012 15:59

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Tue 03 Oct 2017 06:30

- I connect to the database

- I have the select select * from user_objects

--Now i press "Begin" button.

- I know select count( *) from user_objects returns 650 records

-192 records are fetched

-I press "Next Asyn" button for the next group of records

-589 records are fetched so far.

-I will expected the next "Next Asyn" press will return 650-589 records no more, so i press "Next Asyn"

-As you can se the final records fetched are not 650 are 734? why?

in the following link there is a word file with the screens https://1drv.ms/w/s!Ap7GLUK36zn2kXq4eGWMJ__Rn3VE showing the result

Thanks
lewis
 
Posts: 23
Joined: Thu 13 Sep 2012 15:59

Next

Return to dotConnect for Oracle