ORA-01000: 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
sadao
Posts: 1
Joined: Mon 21 Mar 2005 12:06

ORA-01000: maximum open cursors exceeded

Post by sadao » Mon 21 Mar 2005 12:37

Hi all,

I have this problem, when connect some clients in my server application.
My OPEN_CURSORS parameter in Oracle, is set to 300 but, when 10 +/- clients connect, this error is returned.

I have one TOraSession, 3 TOraQuery and 1 TOraStoreProc.
My ODAC Version is 5.50 for Delphi 7

When use BDE components, in my server application, this error no occur.

Thank you for all....

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Mon 21 Mar 2005 14:36

Send us please small demo project to demonstrate the problem and include script to create server objects to ODAC support address.

rodrigo_sjbv
Posts: 1
Joined: Mon 24 Oct 2005 17:11

Post by rodrigo_sjbv » Thu 30 Mar 2006 19:28

Hello!

The following method is called for each insertion of raster data in my application.
I have the Oracle Error "ORA-01000 - Maximum open cursors exceeded" when the number of calls is bigger that OPEN_CURSORS value, like the bug relates. What is wrong in this code? When do I commit the insertion to close the opened cursor, and how?

I tried to put the following line codes after execute the line "RasterBlock_OraQuery->ExecSQL()", without success:
1) RasterBlock_OraQuery->CommitUpdates();
2) Oracle8Session->Commit();
3) OraBlob->Commit();
4) RasterBlock_OraQuery->ApplyUpdates();
5) Oracle8Session->ApplyUpdates();

void TSpatialInformation::InsertRaster( AnsiString id, unsigned char *buf )
{
AnsiString sql = "INSERT INTO SPATIAL_INFORMATION (BLOCK_ID, SPATIAL_DATA) ";
sql += " VALUES (:Block_Id, :Spatial_Data)";

RasterBlock_OraQuery->SQL->Clear();
RasterBlock_OraQuery->SQL->Add(sql);
RasterBlock_OraQuery->ParamByName("BLOCK_ID")->AsString = id;

AnsiString bufS((char *)buf);
TOraLob *OraBlob = new TOraLob(Oracle8Session->OCISvcCtx);
OraBlob->CreateTemporary(ltBlob);
OraBlob->AsString = bufS;
OraBlob->WriteLob();
RasterBlock_OraQuery->ParamByName("SPATIAL_DATA")->ParamType = ptInput;
RasterBlock_OraQuery->ParamByName("SPATIAL_DATA")->AsOraBlob = OraBlob;
RasterBlock_OraQuery->ExecSQL();

OraBlob->FreeLob();
//delete OraBlob;
}

Thanks!

Rodrigo

Post Reply