FetchSize Query

FetchSize Query

Postby JonC » Mon 02 Oct 2006 12:49

I'm experiencing something odd when using PgSqlCommand with FetchSize.

Code: Select all
PgSqlCommand pgCommand = new PgSqlCommand("select column_name from table_name", myPgConnection);
pgCommand.FetchAll = false;
pgCommand.FetchSize = 10000;
pgSqlDataReader pgReader = pgCommand.ExecuteReader();
long Counter = 0;
while(pgReader.Read())
    ++Counter;

Console.WriteLine("{0} records read", Counter);


This will give me a total of 400,000 records. However, I know I've got just over 407,000 records, so if I then do

Code: Select all
while(pgReader.Read())
    ++Counter;

Console.WriteLine("{0} records read", Counter);


(so in effect forcing the loop again) I then get the correct amount out. I've tried this with varying values of FetchSize and it appears to be the last 'chunk' isn't retrieved. So for above, if I change FetchSize to be 5,000, then 405,000 is retrieved (in the main Read()), and 2,000 odd in the additional Read().


I'm not sure if this is a potential bug, me not using the feature correctly, or some weird configuration on my system, but thought I'd throw it your way for comment.

Cheers,

Jon.
JonC
 
Posts: 11
Joined: Fri 29 Sep 2006 10:00

Postby Alexey » Tue 03 Oct 2006 07:08

We are investigating this problem. You'll be notified on results as soon as possible.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby JonC » Wed 11 Oct 2006 15:10

Any news on this? The trial period is running out, and I'm a little wary of purchasing a product that forces me to write ugly and redundant code...
JonC
 
Posts: 11
Joined: Fri 29 Sep 2006 10:00

Postby Alexey » Wed 11 Oct 2006 15:56

We cannot reproduce this problem for now. Need more time for investigation. If you would send us small test project to reproduce this, it would be very helpful.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby JonC » Wed 11 Oct 2006 16:05

I take it a C# file and a pgdump of a sample database will be sufficient?
JonC
 
Posts: 11
Joined: Fri 29 Sep 2006 10:00

Postby Alexey » Thu 12 Oct 2006 10:29

Yes, create a small test project and send it with dump of the database. Use e-mail address provided in the Readme file.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for PostgreSQL