Results 1 to 5 of 5
  1. #1
    jeev81 is offline Member
    Join Date
    Nov 2010
    Posts
    11
    Rep Power
    0

    Default ORA-01000 maximum open cursors exceeded

    Hi,

    I am getting the following java sql exception error on jsp page :


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

    This page connects with database and performs a query whose resultset is displayed on the page.The page get's refreshed every 55 secs or so.After a particular time period I get this error.

    On searching the net I found that when the number of open cursors exceed such an error and the solution lies in properly closing these opened cursors.

    So I tried to close the resultset after execution of the statement (ResultSet.close() ) but the problem still persists after a particular time usually 15 minutes or so I get this error.

    Advice would be appreciated.

    Thanks & Regards,
    Rajeev Nair.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default

    You'll have to show us the code that opens and closes the result set, and any statements as well. You're clearly not closing them correctly.

  4. #4
    jeev81 is offline Member
    Join Date
    Nov 2010
    Posts
    11
    Rep Power
    0

    Default re: code

    Hi,

    I am posting a part of the coding

    [code ]

    <BODY onload="doTimer()" >


    <table align="left" valign="top">


    <tr>
    <td width="10%" class='tdCSS' align="right" valign="top">

    <div class="sc_menu">
    <%

    GetData d = new GetData();
    ResultSet result =null;

    result = d.rs("Select distinct SR_N0 from tech_mail order by SR_N0");

    try {

    while(result.next()){

    String sr = "SR#";
    sr = sr + result.getString(1);

    %>

    <a title=<%=sr%> href="#" onmouseover="stopTimer()" onmouseout="check()" onclick="clicked('<%=sr%>')" ><img src="images/images1.jpg" name ='<%=sr%>' id ='<%=sr%>' width="60" height="60" alt=<%=sr%>/><%=sr%></a>

    <%

    }

    }
    result.close();

    }


    %>

    </div>
    </td>



    [/code]

    GetData( ) class - >contains rs() method which returns the queried resultset



    Regards,
    Rajeev
    Last edited by jeev81; 12-14-2010 at 01:31 PM.

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default

    code tags use square [] brackets.

    You also shouldn't do this sort of thing in a JSP, since it makes it harder to keep track of things. JSPs are for display. A Servlet should be getting the data and then passing it onto the JSP.

    I can't quite see the flow, but when you get the code tags fixed that might help. What does GetData() do? What does it look like? What does the rs() method do and look like?
    Are you leaving your statements open?

Similar Threads

  1. Replies: 0
    Last Post: 10-20-2010, 03:47 PM
  2. Java Cursors
    By 67726e in forum Advanced Java
    Replies: 20
    Last Post: 09-29-2010, 04:09 AM
  3. Replies: 7
    Last Post: 04-01-2010, 10:55 AM
  4. Open Cursors exceeed...question for fellow gurus
    By AlmostAGuru in forum Advanced Java
    Replies: 2
    Last Post: 08-11-2009, 01:37 AM
  5. Exception: max stack exceeded
    By ourip in forum Threads and Synchronization
    Replies: 4
    Last Post: 05-27-2008, 10:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •