Open cursor number increases after each open in NET-mode 5.80.0.41 on Delphi 5
Posted: Tue 08 May 2007 09:04
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.
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.