javax.faces.FacesException: com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: ResultSet is c

T

timmyojo

Hi, I'm developing a Web App using RAD 6.0 (Eclipse) and an IBM
Websphere Application Server. My application creates reports on a
database that has records added to it every minute. When a button is
clicked the first time, the application runs correctly and retrieves
the count of the number of records in the table that have been added
on the current date grouped by the Origin and Transaction type. The
problem occurs when I click the button again to refresh the count; I
encounter the "javax.faces.FacesException:
com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: ResultSet is
closed." I think the problem occurs because the connection object is
trying to get re-used after it has been closed instead of being re-
created. Can anyone help me find out what's wrong and how to fix it?
Here's my code so you can understand better.

public DataSource getDataSource() throws SQLException {
try {
javax.naming.InitialContext ctx = new InitialContext();
ds = (javax.sql.DataSource)ctx.lookup("jdbc/IBXMonitor_Con1");
} catch (NamingException e){
e.getMessage();
}
return ds;
}

public void loadTable(){
PreparedStatement runSummaryQuery;
String SummaryQuery = "SELECT TRX_TYPE, ORIG_CD, COUNT(*) As
RQSTCOUNT"
+ " FROM IBX.TRACK"
+ " WHERE RQST_TM > " + "'" + BeginningTM() + "'"
+ " AND RQST_TM < " + "'" + CurrentTM() + "'"
+ " GROUP BY TRX_TYPE, ORIG_CD";

try {

Connection con1 = getDataSource().getConnection("user", "pswd");
runSummaryQuery = con1.prepareStatement(SummaryQuery,
ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
ResultSet rs = runSummaryQuery.executeQuery();
rs.beforeFirst();
tblSummary = getTblSummary();
tblSummary.setRendered(true);
// Display results in table
while (rs.next()) {
tblSummary.setValue(rs);
}
con1 == null
} catch (SQLException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}

The button on the jsp page simply calls the loadTable() method. If you
need anymore information such as the stack trace I'll be willing to
post it up.

Thanks,
Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top