DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 10

Thread: open cursors

  1. #1
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    1,185
    We are developing a new application using JDBC on Oracle 8.1.6 on Windows NT. After an UPDATE statement, there are around 50 open cursors generated. After closing the browser, the open cursors remain.

    The developer has coded an explicit COMMIT to be run after the update statement. Unfortunately, the open cursors are not closed.

    I have seen this problem on another application using ATG Dynamo.

    Any ideas?

    Thanks in advance.
    David Knight
    OCP DBA 8i, 9i, 10g

  2. #2
    Join Date
    Aug 2001
    Location
    Waterloo, On
    Posts
    547
    Cursors are not closed after Commit!

  3. #3
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    1,185
    Thanks for your response.

    Do you have any ideas on closing the open cursors?

    Thanks in advance.
    David Knight
    OCP DBA 8i, 9i, 10g

  4. #4
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    Check the code and see whether he is opeing any cursors. And add the code to close the cursors explicitly. Other wise set CURSOR_SHARING=FORCE in your init.ora parameter and bounce the instance. Remember it would have its over head of huge soft parses ...

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  5. #5
    Join Date
    Dec 1999
    Location
    Cincinnati, Ohio USA
    Posts
    99
    Error Message: "ORA-01000: maximum open cursors exceeded"
    The number of cursors one client can open at a time on a connection is limited (50 is the default value). You do need to explicitly close the statement, by using the method stmt.close() in order to close and freeup the cursors.

    If you dont close these cursors explicitly, you will get this error eventually. Simply increasing the "OPEN_CURSORS" limit can help you avoid the problem for a while, but that just hides the problem, not solve it. It is your responsibilty to explicitly close out cursors that you no longer need.
    Doug

  6. #6
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    1,185
    I am ignorant in regards to closing cursors.

    Is there a simple command that can be incorporated into the SQL statements to close the cursors?

    Thanks
    David Knight
    OCP DBA 8i, 9i, 10g

  7. #7
    Join Date
    Dec 1999
    Location
    Cincinnati, Ohio USA
    Posts
    99
    I beleieve closeing the cursors is something your developer will have to incorporate into the web page.
    Doug

  8. #8
    Join Date
    Oct 2000
    Posts
    467
    Pls note that in plsql v2 the opened cursors are not closed ,. but cached. This may also cause a problem.
    Which version of plsql r u running ?

    Cheers.
    Vinit

  9. #9
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    1,185
    The developers are using SQL*Plus with JDBC. There is no PL/SQL.

    My understanding is that a cursor is a piece of memory. After the statement is parsed, executed, and the changes are committed, I would think that the cursor would be closed.

    How can the developers close these open cursors?


    David Knight
    OCP DBA 8i, 9i, 10g

  10. #10
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    1,185
    We may have found a solution.

    When the Java code throws exceptions before the statement is fully processed, several open cursors occur.

    The developer has reworked the code so that the throwing of exceptions is done after the SQL statement is fully processed.

    Thanks
    David Knight
    OCP DBA 8i, 9i, 10g

Posting Permissions

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


Click Here to Expand Forum to Full Width