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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:52:52+00:00 2026-05-27T22:52:52+00:00

We have a Java class which loops through a result set, which contains Store

  • 0

We have a Java class which loops through a result set, which contains Store information, and then starts processing ascii files for each respective stores. For each store to process the ascii file takes around 5 minutes. The issue we encountered is after it processes the first store’s ascii file and then fetches the next result set, we get a SQLException saying “DSRA9110E: ResultSet is closed”.

Our code basically looks like this.

private void startProcess() throws Exception {
    PreparedStatement pstmt = null;
    ResultSet rs = null;

    try {
        pstmt = conn.prepareStatement("SELECT STORE_CODE FROM STORE");
        rs = pstmt.executeQuery();

        while (rs != null && rs.next()) {
            System.out.println("Processing store " + rs.getString("STORE_CODE"));

            try {
                processStoreSalesFile();
            } catch (Exception e) {
                conn.rollBack();
                e.printStackTrace();
            }

            if (rs != null) {
                System.out.println("ResultSet is not null");
            }
        }
    } finally {
        if (rs != null) {
            rs.close();
            rs = null;
        }

        if (pstmt != null) {
            pstmt.close();
            pstmt = null;
        }
    }
}

When the error occurs, I do see the system printline “ResultSet is not null”. But when it gets the next ResultSet, it says ResultSet is closed.

I have tried to comment out the code which calls processStoreSalesFile() and we didn’t get this error and it is able to fetch the next ResultSet without throwing any exceptions.

The next attempt I tried is to uncomment the call to the method processStoreSalesFile() and then remove any ascii files from the file system so that the program will have nothing to process. And no exceptions thrown also.

Our setup is WebSphere-Informix. We have another setup WebSphere-Oracle and that didn’t have any problems.

The thing I am suspecting is the ResultSet has timedout or it just didn’t want to wait for the process to finish and closed by itself.

Update 1:
Inside the processStoreSalesFile() method, there’s a conn.commit() call to commit the records. Is it when a commit is called, the ResultSet will be closed? At the WAS admin console, I’ve already added the data source property resultSetHoldability with the value ‘1’. But still the ResultSet is closed.

I hope someone can help me here 🙁

Thanks.

  • 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-27T22:52:52+00:00Added an answer on May 27, 2026 at 10:52 pm

    Here is what we did which worked. Initially, Websphere was configured to use the Informix JDBC driver as its data source, since we are connecting to an Informix database. We changed it to use the DB2 JCC Driver (as proposed by the IBM Informix tech support) and then in the data source custom property, we set the ‘resultHoldability’ value to ‘1’ (HOLD_CURSORS_OVER_COMMIT). Re-ran the program and it managed to loop through all the results in the result set.

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

Sidebar

Related Questions

I have a MATLAB class which contains a reference to a java object classdef
I have a java class which fires custom java events. The structure of the
If I have a java class which is package-private (declared with class, not public
I have an application which resides in ROOT. This application has a java class(in
I have an abstract Class Monitor.java which is subclassed by a Class EmailMonitor.java .
I have two Java classes: B, which extends another class A, as follows :
I have a class User with one field called birthDate which is a java.sql.Date
I have a java class: it.eng.ancona.view.RuoliView$TabElaborazioneFattureValidazione$ElencoDettaglioElaborazioneFattureValidazione$RigaElencoDettaglioElaborazioneFattureValidazione It's so long for multiple inner class. If
I have a java class that applies an xslt to all xml files in
I have a java class and I need to debug it (put breakpoints and

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.