Page 1 of 1

Open cursor number increases after each open in NET-mode 5.80.0.41 on Delphi 5

Posted: Tue 08 May 2007 09:04
by ziper
ODAC 5.80.0.41, Delphi 5, NET-mode, Oracle 10.1, Oracle InstantClient 10.2

Problem description:
1. Create a simple test application with TOraStoredProc component.
2. Define oracle procedure, that returns cursor.
3. Call
TOraStoredProc.Open;
TOraStoredProc.Close;
SELECT v.VALUE AS numopencursors, s.machine, s.osuser, s.username, s.program
FROM V$SESSTAT v, V$SESSION s
WHERE v.statistic# = 3 AND v.SID = s.SID;
4. numopencursors = 8
5. Call
TOraStoredProc.Open;
TOraStoredProc.Close;
SELECT v.VALUE AS numopencursors, s.machine, s.osuser, s.username, s.program
FROM V$SESSTAT v, V$SESSION s
WHERE v.statistic# = 3 AND v.SID = s.SID;
6. numopencursors = 9

When it reaches open_cursor limit I get error "maximum open cursors" exceeded.

There is no problem with non-NET mode.

Our research shows, that OraClasses.pas Line 7905 can be a problem

if not FCommand.NativeCursor then begin
if FCommand.GetCursorState csInactive then
FCommand.Finish;
FFetchCursor.InternalFreeCursor; // ignore ref count
FCommand.SetCursor(nil);
end;

NativeCursor is true, and Cursor is not freed.

Posted: Tue 08 May 2007 10:57
by Plash
We could not reproduce the problem. Please send to odac*crlab*com a complete small sample that demonstrates the problem, including script to create server objects.

Posted: Tue 08 May 2007 12:46
by ziper
Now I can describe the problem

If returned rows OraStoredProc.FetchRows - OK

Posted: Thu 10 May 2007 10:51
by Plash
We could not reproduce the problem with any number of returned rows. In the code of OraClasses.pas that you have provided, the NativeCursor function returns False, and the cursor is freed, when we tested it.

Please send to odac*crlab*com a complete small sample that demonstrates the problem, including script to create server objects.