Page 1 of 1

TOraQuery Problem

Posted: Fri 13 Dec 2013 14:45
by tracer609
Hi,

I have the following problem. I have a batch application which uses TOraQuery component to fetch data from SQL statement which returns several millions of rows. I see that TOraQuery component consumes a big amount of memory while fetching millions of rows during processing. The question is : how to limit the memory consumption by TOraQuery component during fetching of big row number. This issues causes out of memory issue.

Thanks,
Michael

Re: TOraQuery Problem

Posted: Fri 13 Dec 2013 15:06
by AlexP
Hello,

When reading data from the DB, they are stored in the DataSet, and especially when reading large data, the Out of memory error can occur. To avoid this, you can use the UniDirectional mode and disable the FetchAll option. In this case, the DataSet will store only the number of records specified in the FetchRows property (the number of records fetched for one fetch operation). When fetching the next portion of data, the previous one will be deleted.