Dataset ReadBuffer problem

If I create an object of type TOracleDataset in delphi code - without drag and drop from component palette, it ignores the property ReadBuffer which I set to 1000.

My sample code:

TestDataSet := TOracleDataSet.Create(self);
TestDataSet.Session := self.OracleSession;
TestDataSet.SQL.Add('SELECT ID FROM EMPLOYEES');
TestDataSet.ReadBuffer := 1000;
TestDataSet.Open;

In SQL Monitor I see that only 25 records are fetch every time instead of 1000.

If I drag and drop OracleDataSet component from component palette it works OK (fetches 1000 rows without problems)

Both of the datasets uses the same TOracleSession.
What am I doing wrong?
 
OK, I will ansver to my self:

TestDataSet := TOracleDataSet.Create(self);
TestDataSet.READONLY := FALSE;
TestDataSet.Session := self.OracleSession;
TestDataSet.SQL.Add('SELECT ID FROM EMPLOYEES');
TestDataSet.ReadBuffer := 1000;
TestDataSet.Open;

Once the program is compiled with the TestDataSet.READONLY := FALSE; you can remove this line from the code and all will work OK, considering the ReadBuffer value.

Definitely a bug to fix.
 
Once the program is compiled with the TestDataSet.READONLY := FALSE; you can remove this line from the code and all will work OK, considering the ReadBuffer value.
This is a bit puzzling. You mean that after you added this line and removed it again, all works okay? In that case something else was going on.
 
Thats the way I do:
1.) add the line dataset.readonly := true/false
2.) compile the program
3.) remove that line

I am using delphi 7.0, and components DOA are about one year old, if you want I can write you the exact version.

I have to say that it is not important what you define for readonly (True or False), it works OK.

I tried this in 5 different datasets and anyone of them worked without using that trick of adding and removing that row.

Strange also to me, but this was my today new experience :)
 
Wierd, I've just hit this problem with one of my datasets!

QueryAllRecords = true, Readbuffer is set at 100 but when the dataset is opened it returns 1 record at a time, taking ages to retrieve the 63 records

I've tried changing the readonly property but unfortunately it doesn't make any difference for me.

I've also tried with a new dataset component, copied the SQL, created the fields from scratch, but nope, still returns 1 row/fetch.

Baffled!!!!
 
If the result set inludes long/lob fields, then the ReadBuffer value is overruled. Could this be the case here?
 
Back
Top