error 01000 Maximum opened cursors exeeded

I have read a lot of topics about this exception, but didn't I find a sulution for me. I use Oracle Client for database 10g and DOA 4.0.7.1. The sample code return en exceptions exactly on the loop when i = 299. This means that application every time opens a new cursor and not reuses the "cashed" cursor. And here is the famous error "Maximum opened cursors exeeded". What em I doing wrong???

for i := 0 to 3000 do
begin
ods_cursor.CloseAll;
ods_cursor.ExternalCursor := cursors.Getplanshifts('381');
ods_cursor.Open;
end;
 
What exactly does cursors.Getplanshifts('381') do? Does it dynamically create a TOracleQuery instance? If so, you must also close/free it.
 
Back
Top