Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 523789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:29:56+00:00 2026-05-13T08:29:56+00:00

I am facing ORA-01000: maximum open cursors exceeded although I am closing the resultsets

  • 0

I am facing ORA-01000: maximum open cursors exceeded although I am closing the resultsets in finally block. But I suspect there is some trouble with my legacy code, below is my pseudo-code

while (someCondition) {
rs1=executePreparedStatementNew(query1,param1,""); 
//do something with rs1
rs1=executePreparedStatementNew(query2,param2,""); 
}
  1. If the loops runs 5 times, how many cursor will be opened by this code ?
  2. If I close rs1 in finally, how many cursors will be closed, some people say that rs1 instance for query1 will not be closed as it is masked by query2 instance.
  3. Does resultsets really gets masked this way , if so, how to ensure that all the instances are closed.

Appreciate any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:29:56+00:00Added an answer on May 13, 2026 at 8:29 am

    You haven’t said where your finally block is, but if it’s outside the while loop, then yes you will have unclosed result sets. The rs1 variable will refer to the “latest” result set fetched – so that’s the only one which will be closed. There’s nothing magical going on here – it’s just the normal behaviour of variables.

    I would suggest that you separate each “fetch result set and use it” case into its own method, and close the result set in a try/finally block within that method. That will make it fairly clear what’s going on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When facing the problem of validating a property in a JSF2 application there are
I am new to Oracle, and there is an issue I am facing. When
recently I've been playing with DCG in Prolog but I've been facing some issues
Facing some issue in Talend Admin Console, the jobs that are running from IDE
Facing a problem, it seems my data stored in SQL Server does not stored
issue facing while loading the messages in to mq channel, recieving an error like
Iam facing problem in understanding and converting a matlab code into opencv. I want
iam facing problem in passing array to view. this is my controller code.. function
Im facing one problem in streaming data capture for reading the broadcast data during
Guyz facing problems with creating a push notification service (for android) using Google C2DM

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.