Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ORA-01000: maximum open cursors exceeded

 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic