Board index » delphi » Delphi / Oracle / BDE 5 Memory Leak

Delphi / Oracle / BDE 5 Memory Leak

We have an issue with Oracle and BDE 5.2 and 5.12 that is documented in the
bdereadme.txt file from Borland like this

"A memory leakage may occur when executing a query many times. Workaround:
call DbiQFree() and DbiQPrepare() every time the query is executed."

Does anyone have a concrete example of how to implement this fix as the
above sentence is vague and does not include a proper example. Fo instance,
do I call DBiDFree and DbiQPrepare before or after the call to execute. Also
what parameters do I pass in

Also does it include TQuery.Open and / or TQuery.ExecSQL as above it only
says 'execute' which is a vague term also

Mark Winn
Research & Development Manager

IBA Technologies Asia Pte Ltd
83 Science Park Drive
#01-01/02 The Curie
Singapore Science Park
Singapore 118258
Tel : +65 778 0066
Fax : +65 777 9401
Email : mark.w...@ibatech.com
www.ibatech.com

 

Re:Delphi / Oracle / BDE 5 Memory Leak


Quote
Mark Winn wrote:
> "A memory leakage may occur when executing a query many times. Workaround:
> call DbiQFree() and DbiQPrepare() every time the query is executed."

> Does anyone have a concrete example of how to implement this fix as the
> above sentence is vague and does not include a proper example. Fo instance,
> do I call DBiDFree and DbiQPrepare before or after the call to execute. Also
> what parameters do I pass in

while True do
begin
   with AQuery do
   try
     Sql.Add('SELECT SOMETHING FROM ATABLE WHERE AFIELD = :AFIELD');
     Prepare;
     (set the parameter)
     Open;
     finally
        UnPrepare;
     end;
end;

Note that this totally defeats the purpose of preparing the SQL, and turns
Oracle into the equivalent of Paradox, which is what the BDE is really
comfortable with.

If you use Oracle, s{*word*99} the BDE and get Direct Oracle Access
(www.allroundautomations.nl) or ODAC, or, perhaps, try dbExpress.

John Pierce

Other Threads