Maximum Open Cursor Exceeded

Maximum Open Cursor Exceeded

Postby arv » Thu 26 Mar 2015 12:28

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?
arv
 
Posts: 6
Joined: Thu 05 Mar 2015 16:58

Re: Maximum Open Cursor Exceeded

Postby MariiaI » Fri 27 Mar 2015 14:20

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/16676859/how-to-update-cursor-limit-for-ora-01000-maximum-open-cursors-exceed
http://docs.oracle.com/cd/E40329_01/admin.1112/e27149/cursor.htm#OMADM5352
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Maximum Open Cursor Exceeded

Postby arv » Tue 31 Mar 2015 10:57

using block is the solution. Thanks.
arv
 
Posts: 6
Joined: Thu 05 Mar 2015 16:58


Return to dotConnect for Oracle