• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.sql.SQLException: ORA-01000: maximum open cursors exceeded

 
raj chopra
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using hibernate 3.0,spring 1.2,struts 1.2.

most of the code deals with hibernate and some orther parts with jdbc connections.

the places where jdbc connection was used, prepared statements,connection cons, and results sets were used and they were later not closed.

i believe this would be root cause to this error. so iam planning to close all three jdbc related in code using finally block.
on the orther end of the line , i am planning to increase my cursors size in oracle 9i db as well.

kindly guide me , appropriate steps to close these connection, or any orther way to close these cursors through in the code.

sample code :


thanks in advacne
 
G krishna kumar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the problem is when you opening a connection, statement,resultset it is recomanded to close the connection and statement ans resultset.
it will work. fne
 
raj chopra
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi krishna,

thanks for reply

G krishna kumar wrote:the problem is when you opening a connection, statement,resultset it is recomanded to close the connection and statement ans resultset.
it will work. fne


i am closing the all the connections,resultsets etc as suggested. however this process needs to be done through out my project and without effecting any functional changes.
so iam looking for a way to identify such a part of code where more number of connections opened, or like more number of resultsets are used, more like to track the trouble part of code .
if i am able to track them i am planning to close them on top proirity. any ideas will be appreciated.

thanks in advace.
 
G krishna kumar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi chopra,

please go through the following url. http://www.ypl.com/oracle/manuals/pl_sql_user_guide/articles/max_open_cursors_exceeded_bea.htm
http://www.zugiart.com/2010/08/handling-oracle-cursors-in-jdbc/ : refer the summary

my suggestion is that identify your java applications where you are performing the database operation to obtain the connections.
then try to close all the connection in all appropriate java application.

i hope that it will give you some idea.

http://www.coderanch.com/t/300088/JDBC/databases/ORA-maximum-open-cursors-exceeded

Regards
Kumar.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic