Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Q about JDBC driver classes: how many open cursors

 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is there a way to find out how many open
database cursors there are with the JDBC
driver classes?

I need this info to investigate the cause
of an Oracle problem regarding the use of
too many cursors.

Cheers,

Gian Franco
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There isn't. But I can tell you what your cursor problem is - been there, done that, got the tar and feathers - it's a resource leak. Somewhere in your code (or a library you use) JDBC Statement objects are not being closed. The Oracle driver does not seem to clean up unclosed statements; maybe the Connection keeps a reference to them, or they don't have a finalize method. If you are using a connection pool this means the Statement, and all its open result sets, stays around forever. Eventually you will run out of cursors.

Be religious about closing all your statements and connections in a finally clause.

- Peter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic