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 8432967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:15:45+00:00 2026-06-10T06:15:45+00:00

I started getting the below SQL exception and I don’t know what’s the root

  • 0

I started getting the below SQL exception and I don’t know what’s the root cause for this exception? I am also closing dbconnection and prepared statement too. Then what’s the problem?

java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-01000: maximum open cursors exceeded
ORA-00604: error occurred at recursive SQL level 1
ORA-01000: maximum open cursors exceeded
ORA-01000: maximum open cursors exceeded

Below is my code which I am using. Anything wrong in my code?

for (Entry<Integer, LinkedHashMap<Integer, String>> entry : GUID_ID_MAPPING.entrySet()) {

    pstatement = db_connection.prepareStatement(PDSLnPConstants.UPSERT_SQL); // create a statement
    pstatement.setInt(1, entry.getKey());
    pstatement.setString(2, entry.getValue().get(PDSLnPConstants.CGUID_ID));
    pstatement.setString(3, entry.getValue().get(PDSLnPConstants.PGUID_ID));
    pstatement.setString(4, entry.getValue().get(PDSLnPConstants.SGUID_ID));
    pstatement.setString(5, entry.getValue().get(PDSLnPConstants.UID_ID));
    pstatement.setString(6, entry.getValue().get(PDSLnPConstants.ULOC_ID));
    pstatement.setString(7, entry.getValue().get(PDSLnPConstants.SLOC_ID));
    pstatement.setString(8, entry.getValue().get(PDSLnPConstants.PLOC_ID));
    pstatement.setString(9, entry.getValue().get(PDSLnPConstants.ALOC_ID));
    pstatement.setString(10, entry.getValue().get(PDSLnPConstants.SITE_ID));
    pstatement.executeUpdate();

    }

} catch (SQLException e) {
    getLogger().log(LogLevel.ERROR, e);
} finally {
    if (pstatement!= null) {
    try {
        pstatement.close();
        pstatement = null;
    } catch (SQLException e) {
        getLogger().log(LogLevel.ERROR, e.getMessage(), e.fillInStackTrace());
    }
    }
    if (db_connection!= null) {
    try {
        db_connection.close();
        db_connection = null;
    } catch (SQLException e) {
        getLogger().log(LogLevel.ERROR, e.getMessage(), e.fillInStackTrace());
    }
    }
  • 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-06-10T06:15:47+00:00Added an answer on June 10, 2026 at 6:15 am

    I think the PreparedStatement definition should be pulled out of the loop and reused within the loop by calling clearParameters:

    pstatement = db_connection.prepareStatement(PDSLnPConstants.UPSERT_SQL); // create a statement
    
    for (Entry<Integer, LinkedHashMap<Integer, String>> entry : GUID_ID_MAPPING.entrySet()) {
    
        pstatement.setInt(1, entry.getKey());
        pstatement.setString(2, entry.getValue().get(PDSLnPConstants.CGUID_ID));
        pstatement.setString(3, entry.getValue().get(PDSLnPConstants.PGUID_ID));
        pstatement.setString(4, entry.getValue().get(PDSLnPConstants.SGUID_ID));
        pstatement.setString(5, entry.getValue().get(PDSLnPConstants.UID_ID));
        pstatement.setString(6, entry.getValue().get(PDSLnPConstants.ULOC_ID));
        pstatement.setString(7, entry.getValue().get(PDSLnPConstants.SLOC_ID));
        pstatement.setString(8, entry.getValue().get(PDSLnPConstants.PLOC_ID));
        pstatement.setString(9, entry.getValue().get(PDSLnPConstants.ALOC_ID));
        pstatement.setString(10, entry.getValue().get(PDSLnPConstants.SITE_ID));
        pstatement.executeUpdate();
    
        pstatement.clearParameters();
    
    }
    

    You may also want to investigate batch processing (addBatch). If you are testing, you may need to wait a bit for the existing “open” cursors to be cleaned up.

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

Sidebar

Related Questions

I'm getting the following exception for the code included below that. This works fine
I just started getting this error today, seemingly out of nowhere. Any one see
Out of the blue today I started getting this error in Visual Studio 2008
I'm getting the below error: Started by user anonymous Checkout:workspace / /var/lib/hudson/jobs/test2/workspace - hudson.remoting.LocalChannel@1e77243d
The view below is a container for three user controls, and I started getting
OK have just started getting this error and I'm not sure why. I have
This is a follow-up to: Getting Started With ASP.NET MVC3 & Google Checkout: Take
I have simple WCF Service Application (based on this tutorial : Getting Started ).
I really don't know where to begin with this question, but the site I'm
I recently migrated to new version of protobuf-net, and i started getting this error

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.