File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes ORA-01000: maximum open cursors exceeded Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ORA-01000: maximum open cursors exceeded" Watch "ORA-01000: maximum open cursors exceeded" New topic
Author

ORA-01000: maximum open cursors exceeded

Mani Ram
Ranch Hand

Joined: Mar 11, 2002
Posts: 1140
Okay. I know this error happens when we don't close the connections / statements / resultsets properly. But, is there a way to find out which connection / statement / resultset is left open? This is a huge application and it is next to impossible to do a code review and find out where the mistake lies.
Is it possible somehow to know which connection / statement / resultset is creating the problem? (either by monitoring at the Oracle end or using some logging in Java front?)

Thanks in advance.


Mani
Quaerendo Invenietis
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


Okay. I know this error happens when we don't close the connections / statements / resultsets properly

It also happens when you haven't allocate enough cursors in Oracle to support your app in the first place. I'd check that too.

You are able to get the session ID which is holding the cursor open through Oracle I think - you'd have to look this up in the docs though, because I can't remeber offhand how its done.

This might be a little after the fact I know, but a good DAO framework would help prevent this sort of error.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Mani Ram
Ranch Hand

Joined: Mar 11, 2002
Posts: 1140
Thanks.
The cursor size is set to 1000 in Oracle -more than enough for this application.
And, it is currently not possible to make any big changes to this application. So the DAO approach is ruled out, at least for now.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
It will be quite tedious. I fear you can't do much more than test each part of the code and check the Oracle logs for opening and closing of connections while you're doing it.

Might be easier to get a bunch of students through a work agency for a few days to munch over the code line by line.
[ May 25, 2004: Message edited by: Bear Bibeault ]

42
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ORA-01000: maximum open cursors exceeded