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

Rogue Cursors in Oracle

 
M Robinson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are calling a variety of Stored procedures from a servlet running on WebLogic. We are periodically receiving Max cursor open errors during our testing, even though we are the only client accessing the server. We have placed all of the relevant close calls (ResultSets, Statements and Connnections) in finally clauses for the relevant methods and we are sure they are being closed. We have looked in our WLS connection pool and there are no open connections after our close calls have been made. However, if we interrogate the database for open cursors, we see all of our calls still active. Does anyone have any suggestions regarding next steps.
Thanks in advance!!!
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Search for all statements and resultsets and make sure they all get closed!
After you have made sure that #1 isn't the culprit, Oracle has some internal problems with prepared statements. On some occasions, even though you close the resultset and prepared statements, the cursors remain open. Soon you will get "Ora-1000 max number of cursors exceeded" or something to that effect. There are 3 workarounds:
2. set max number of open cursors in Oracle to a high number (at least 200... the default is 40ish) as this does not effect performance of the DB.
3. force a rollback: connection.rollback()
4. close the connection: connection.close()
hope this helps
NOTE: try updating your jdbc drivers to the latest ( and most bug free ) drivers possible.
Jamie
[ July 30, 2002: Message edited by: Jamie Robertson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic