Page 1 of 1

Maximum Open Cursor Exceeded

Posted: Thu 26 Mar 2015 12:28
by arv
Hi,

We're using stored procedures for CRUD operations in our system
Some of them returns data with ref_cursor.

CURSOR_COUNT is 1000 on Oracle.
When we try to loop a sp shown as below, we're facing with error :

Devart.Data.Oracle.OracleException:
ORA-01000: maximum open cursors exceeded ORA-06512: at "DB_TEST.SP_TEST"

Code: Select all

for (int i=0; i< 2000; i++)
{
ISingleResult<SP_TESTResult> result = ContextManager.Context.SP_TEST(param1, param2);
...
}
Can you please offer a solution about this issue?

Re: Maximum Open Cursor Exceeded

Posted: Fri 27 Mar 2015 14:20
by MariiaI
We couldn't reproduce this error with the latest build of dotConnect for Oracle 8.4.379.
Please try using this code:

Code: Select all

for (int i=0; i< 2000; i++)
{
  using(ISingleResult<SP_TESTResult> result = ContextManager.Context.SP_TEST(param1, param2)) {
    ...
  }
}
If this doesn't help, please provide us the following information:
- Oracle Server and Oracle Client (if it is used) versions;
- the version of dotConnect for Oracle;
- the DDL scripts for the stored procedure and necessary database table(s);
- if possible, create and send us a small test project.

Also, similar issues with reasons and solutions have been discussed here:
http://stackoverflow.com/questions/1667 ... ors-exceed
http://docs.oracle.com/cd/E40329_01/adm ... #OMADM5352

Re: Maximum Open Cursor Exceeded

Posted: Tue 31 Mar 2015 10:57
by arv
using block is the solution. Thanks.