6 Replies Latest reply: Apr 11, 2012 6:11 PM by jschellSomeoneStoleMyAlias RSS

    Exception thrown like ORA-01000

    858277
      Hi,

      I am getting the error in my java code like ORA-01000.

      Exception :ORA-01000: maximum open cursors exceeded

      How to check through code whether the cursor is opened or closed.

      Can anyone please help me to resolve this incident?.
        • 1. Re: Exception thrown like ORA-01000
          gimbal2
          Dhiva wrote:
          Hi,

          I am getting the error in my java code like ORA-01000.

          Exception :ORA-01000: maximum open cursors exceeded

          How to check through code whether the cursor is opened or closed.

          Can anyone please help me to resolve this incident?.
          You don't need to program that; YOU will know when a cursor is open or not because you write code that opens them. So also write code that closes them, preferably in a finally {} clause so you are sure it happens even if the code blows with an exception.

          This link may be of interest to you:

          http://www.zugiart.com/2010/08/handling-oracle-cursors-in-jdbc/
          • 2. Re: Exception thrown like ORA-01000
            Dhiva wrote:
            Hi,

            I am getting the error in my java code like ORA-01000.
            Exception :ORA-01000: maximum open cursors exceeded

            How to check through code whether the cursor is opened or closed.
            Can anyone please help me to resolve this incident?.
            Moderator Advice:
            You already have a multi-page discussion in progrress in one of the database forums:
            ORA-01000
            Don't confuse the issue by cross-posting.
            • 3. Re: Exception thrown like ORA-01000
              gimbal2
              rukbat wrote:
              Dhiva wrote:
              Hi,

              I am getting the error in my java code like ORA-01000.
              Exception :ORA-01000: maximum open cursors exceeded

              How to check through code whether the cursor is opened or closed.
              Can anyone please help me to resolve this incident?.
              Moderator Advice:
              You already have a multi-page discussion in progrress in one of the database forums:
              ORA-01000
              Don't confuse the issue by cross-posting.
              doh : (
              • 4. Re: Exception thrown like ORA-01000
                gimbal2 wrote:

                doh : (
                ... it's because I glance through every forum category,
                even those that I have absolutely no idea what they're talking about,
                (who knows? I might learn something!)
                ... that I'd see the other thread.

                I still don't know what this issue might be.
                So, if it is also appropriate to be here, let's see if the O.P. ever gets around
                to displaying their questionable code, so that it might get corrected.
                • 5. Re: Exception thrown like ORA-01000
                  926972
                  ERROR:
                  ORA-01000: Maximum open cursors exceeded

                  SOLUTIONS:

                  SQL> show parameter cursor_;
                  SQL> alter system set open_cursor=1000;
                  Or
                  SQL> alter system set open_cursor=1000 scope=spfile;
                  SQL> SHUT immediate
                  SQL> STARTUP;
                  SQL> show parameter cursor_;

                  Shahid Hussain Abro
                  Assistant Commissioner, SRB

                  Edited by: SHAHID HUSSAIN ABRO on Mar 28, 2012 5:13 AM
                  • 6. Re: Exception thrown like ORA-01000
                    jschellSomeoneStoleMyAlias
                    SHAHID HUSSAIN ABRO wrote:
                    ERROR:
                    ORA-01000: Maximum open cursors exceeded

                    SOLUTIONS:

                    SQL> show parameter cursor_;
                    SQL> alter system set open_cursor=1000;
                    Or
                    SQL> alter system set open_cursor=1000 scope=spfile;
                    SQL> SHUT immediate
                    SQL> STARTUP;
                    SQL> show parameter cursor_;

                    Shahid Hussain Abro
                    Assistant Commissioner, SRB
                    If you are suggesting that the solution is to modify the database to allow more open cursors then you are almost certainly wrong.

                    Posters here do not have a problem with applications that need to use more cursors. What they have is a failure to properly close the cursors that they do use. And your solution will not correct that problem and could even make it worse as cursors require system resources.

                    Worse it could end up hiding the problem because the application with volume X might operate for some time, but then start failing because the volume goes above X and by then no one remembers that the wrong solution was applied.