ORacle cursor remains open even after active:=false

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
amoroder
Posts: 30
Joined: Sun 12 Sep 2010 11:33

ORacle cursor remains open even after active:=false

Post by amoroder » Fri 21 May 2021 14:15

Hello,

I have the following strange behaviour in one of our selects
We have a TOraQuery object we set the sql, prepare, activate, read the data and deactivate

try
dmDaten.qrdummy.SQL.Text := 'select * from pat_allergien ' +
'where paal_kennr = :pKennr';
dmDaten.qrDummy.ParamByName('pKennr').Value := pKennr;
dmDaten.qrDummy.Prepare;
dmDaten.qrDummy.Active := True;
if dmDaten.qrDummy.RecordCount > 0 then
begin
do what we want to do
else
do somethin other
end;

finally
dmDaten.qrDummy.Active := False;
end;

When the procedure ends according to a select on v$open_cursor
the oracle cursor remains open and sql_text contains the select

All the other select or procedures we execute close the cursor.

I tried to add dmDaten.qrDummy.close but it did not close the cursor.
Could you please tell me what's wrong with my code.

Greetings
Andreas

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: ORacle cursor remains open even after active:=false

Post by MaximG » Fri 18 Jun 2021 12:11

Sorry for the late reply. We couldn't reproduce the issue by using this code fragment. Could you send us a complete project along with the script for creating the pat_allergien object? For your convenience, please use the e-support form https://www.devart.com/company/contactform.html

Post Reply