Free memory after reading record in TOraQuery

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
[email protected]
Posts: 27
Joined: Fri 12 Feb 2010 07:44

Free memory after reading record in TOraQuery

Post by [email protected] » Mon 23 Aug 2010 09:17

Hello,

I have that kind of code:

(...)

// geom is column type of SDO_GEOMETRY. There are many rows in table TABLE_WITH_GEOMETRY
// parameter "FetchRows" is set 25

query->SQL->Add( "SELECT geom FROM TABLE_WITH_GEOMETRY" );
query->Open();

TOraObject *OraGeometry;

while ( !query->Eof )
{
OraGeometry = query->GetObject( "geom" );


// data procesing


OraGeometry->FreeObject();

query->Next();
}

My problem is: execution command "query->Next()" doesn't free memory taken by previous record. I would like to release previous record from memory because I don't need it any more.
Because I can't do it now I have huge leak of memory and I can't to process all records from table.

Is it possible to free that memory in some way?

Regards,

Wojto

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

Post by AlexP » Fri 27 Aug 2010 12:24

Hello,

To reduce memory usage, you can set
OraQuery->UniDirectional property to true.

For more information about the UniDirectional property, read ODAC help about 'TTCustomDADataSet.UniDirectional'

[email protected]
Posts: 27
Joined: Fri 12 Feb 2010 07:44

Post by [email protected] » Thu 02 Sep 2010 12:17

It works. Thank's for your help.

Regards
Wojto

Post Reply