How to overcome this error
java.sql.SQLException: ORA-01000: maximum open cursors exceeded
Iam not getting this error frequently. In rare instantce its happening.
Pls do let me know
1) In Which scenrios this error will come
2) How to over come this ?
-
How to overcome maximum open cursors error (6 messages)
- Posted by: Srin Reddy
- Posted on: April 28 2004 09:50 EDT
Threaded Messages (6)
- How to overcome maximum open cursors error by Deepak Gupta on April 28 2004 10:41 EDT
- close all the resources by H Roy on April 28 2004 15:03 EDT
-
how can we use the resultset? by Yasoda Supraja on February 24 2006 05:13 EST
- re: how can we use the resultset? by Cool Dude on March 29 2006 05:17 EST
-
how can we use the resultset? by Yasoda Supraja on February 24 2006 05:13 EST
- close all the resources by H Roy on April 28 2004 15:03 EDT
- Close all the resources by Kenneth Phang on April 28 2004 13:09 EDT
- chitu by ravipati chaitanya on November 03 2011 04:29 EDT
-
How to overcome maximum open cursors error[ Go to top ]
- Posted by: Deepak Gupta
- Posted on: April 28 2004 10:41 EDT
- in response to Srin Reddy
1. All the resources (including cursors) are released when a connection is closed.
You may need to release unused cursors sooner by closing unused resultsets <I would suggest a code review to fix this problem.
2. If problem still remains that means your application needs more open cursors, ask your DBA to increase the number of open cursors that can be maintained with database your application is connecting to.
-DG -
close all the resources[ Go to top ]
- Posted by: H Roy
- Posted on: April 28 2004 15:03 EDT
- in response to Deepak Gupta
We had the same problem in our application. We were using a connection object and executing queries
n times within a loop and not closing ResultSet/Statement object at the end of each loop iteration
We closed all the ResultSet/Statement object after each iteration and resolved the issue.
You can log-in as admin in your database and you can check number of open cursors throug sql commands
execute the module and find out which part of code is giving problem. If you are using Oracle DB then
you can connect through Toad and get all the details -
how can we use the resultset?[ Go to top ]
- Posted by: Yasoda Supraja
- Posted on: February 24 2006 05:13 EST
- in response to H Roy
Hi,
How can we use the result set if we are closing after every Iteration? It will give exception. -
re: how can we use the resultset?[ Go to top ]
- Posted by: Cool Dude
- Posted on: March 29 2006 17:17 EST
- in response to Yasoda Supraja
You don't have to close the ResultSet immediately afterwards ... you can do your work and then close the ResultSet. So, don't create a Collection of ResultSet objects. Get one, do your thing, then get the next, etc.
This exception is triggered after a certain number of calls. You could keep a counter and refresh your connection before you go over this max. This is a hack ... -
Close all the resources[ Go to top ]
- Posted by: Kenneth Phang
- Posted on: April 28 2004 13:09 EDT
- in response to Srin Reddy
Dont reuse connection, preparestatement and resultset .... -
chitu[ Go to top ]
- Posted by: ravipati chaitanya
- Posted on: November 03 2011 04:29 EDT
- in response to Srin Reddy
this may occur in recursive calling of the code.
just increase your cursor limit in the databese configurationj file.