SQL Error: Out of memory. Driver buffering all records.

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
alexer
Posts: 30
Joined: Tue 26 Dec 2006 14:07

SQL Error: Out of memory. Driver buffering all records.

Post by alexer » Wed 26 Sep 2012 13:16

Hello,
We have some issue with the dxEpress driver for MS SQL
TSQLQuery is a unidirectional dataset. Unlike other datasets, unidirectional datasets do not buffer multiple records in memory.
But your driver buffer all records in memory, as a result in query with more then 1M records we get SQL Error:Out of memory. In the same time, with standart MS SQL driver, there are no such issues.

Simple test. Delphi7 + MS SQL 2008R2
Create table with more then 100k records.
Start Delphi7, look at its memory usage. In my case it was about 26M.
Then place TSQLConnection and TSQLQuery on form. First try standart MS driver with query "select * from TABLE1". After activating query there was no process activity and memory usage was still 26M.
If we use your driver delphi takes 50% of CPU for about 10-15 sec and raises memory to 150M.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: SQL Error: Out of memory. Driver buffering all records.

Post by AlexP » Tue 02 Oct 2012 14:00

hello,

By default, in our driver, the FetchAll option is set to True, and, when opening DataSet, all records from a table are fetched to a client. To change this behaviour, you should set this option to False in TSQLConnection

Post Reply