ODAC : maximum open cursors exceeded

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
RR

ODAC : maximum open cursors exceeded

Post by RR » Fri 05 May 2006 09:49

My server ( Oracle 9i (10g) ) has the following stored procedure



CREATE OR REPLACE PACKAGE PKG IS
TYPE SELCUR IS REF CURSOR;
procedure get_data(datebegin in date, dateend in date, c1 out selcur);
END PKG;

CREATE OR REPLACE PACKAGE BODY PKG IS
procedure get_data(datebegin in date, dateend in date, c1 out selcur) as
begin
open c1 for
select charge from t where (t.db > datebegin and t.db

OraSession := TOraSession.Create(nil);
OraSession.ConnectString := 'eacnew/[email protected]:1521:orcl';
OraSession.Options.Net := True;

OraStored := TOraStoredProc.Create(nil);
OraStored.Session := OraSession;
OraStored.StoredProcName := 'eacnew.pkg.get_data';

i := 0;

while i < 1000 do begin
Memo1.Lines.Add(' i = ' + IntToStr(i));
OraStored.Prepare;

OraStored.ParamByName('datebegin').AsDateTime := EncodeDate(2005, 12, 1) + i;
OraStored.ParamByName('dateend ').AsDateTime := EncodeDate(2005, 12, 2) + i;
OraStored.Execute;

while not OraStored.Eof do begin
Memo1.Lines.Add(IntToStr(i) + ' ' + OraStored.FieldByName('charge').AsString);
OraStored.Next;
end;

Inc(i);
end;

OraStored.Free;
OraSession.Free;

when i=330 I get 'Net error : Maximum open cursors exceeded'

Is there any way to close opened cursor in while..end after getting all data?

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Sat 06 May 2006 11:41

We couldn't reproduce this error. Please send to ODAC support address complete sample that demonstrates this problem and include script to create server objects.

Belitski
Posts: 14
Joined: Wed 02 Aug 2006 12:52

Same problem

Post by Belitski » Wed 02 Aug 2006 12:58

Hi,
i have the same problem as you.
Did you find out what was wrong?
I thought the problem was fixed in a newer ODAC version,
but this is not the case.
There is no error if NET option is set to false.
Thank you in advance,
Vladimir

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Thu 03 Aug 2006 12:46

We didn't find a solution because we couldn't reproduce the problem using information the user RR specified. If you have a small sample that reproduces this problem please send it to ODAC support address. And also inform us about versions of ODAC and Oracle you use.

Don Horn
Posts: 6
Joined: Sat 12 Aug 2006 21:08
Location: Atlanta, GA

Post by Don Horn » Tue 15 Aug 2006 13:56

What is your Orainit parameter 'open_cursors' (max # cursors per session) set at? This parameter is not session modifiable so you will have to bounce database to change.

Post Reply