We are getting the following exception with nested resultset -
com.ibm.db2.jcc.b.SqlException: Invalid operation: result set closed.
On doing some more research online, I found a simialar article which mentioned with db2jcc, the default mode for ResultSet
is TYPE_FORWARD_ONLY.
When it first reaches the end of the ResultSet, it returns false and
closes the ResultSet!
So when rs2 is completed, it closes rs2 but why is ResultSet rs1 also
closed when there are more rows in rs1?
The workaround for this is to change the ResultSet type to
TYPE_SCROLL_SENSITIVE / TYPE_SCROLL_INSENSITIVE
Could anyone advice how to change the result set type? We are using hibernate so there is no where in my code where I am defining and using result set. Is there any configuration we can change to set up hibernate to use result set with TYPE_SCROLL_SENSITIVE / TYPE_SCROLL_INSENSITIVE??
Please advice.
Stack Trace:
[9/13/07 20:36:52:862 EDT] 00000034 SystemOut O 2007-09-13 20:36:52,862 [WebContainer : 0] INFO GZIPFilter - GZIP supported, compressing
[9/13/07 20:36:53:085 EDT] 00000034 SystemOut O 2007-09-13 20:36:53,085 [WebContainer : 0] WARN JDBCExceptionReporter - SQL Error: -99999, SQLState: null
[9/13/07 20:36:53:085 EDT] 00000034 SystemOut O 2007-09-13 20:36:53,085 [WebContainer : 0] ERROR JDBCExceptionReporter - Invalid operation: result set closed
[9/13/07 20:36:53:085 EDT] 00000034 SystemOut O 2007-09-13 20:36:53,085 [WebContainer : 0] WARN JDBCExceptionReporter - SQL Error: -99999, SQLState: null
[9/13/07 20:36:53:085 EDT] 00000034 SystemOut O 2007-09-13 20:36:53,085 [WebContainer : 0] ERROR JDBCExceptionReporter - Invalid operation: result set closed
[9/13/07 20:36:53:107 EDT] 00000034 SystemOut O 2007-09-13 20:36:53,086 [WebContainer : 0] ERROR JDBCExceptionReporter - Could not execute query
com.ibm.db2.jcc.b.SqlException: Invalid operation: result set closed
at com.ibm.db2.jcc.b.kf.lb(kf.java:3498)
at com.ibm.db2.jcc.b.kf.a(kf.java:1430)
at com.ibm.db2.jcc.b.kf.getString(kf.java:1294)
at com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.getString(WSJdbcResultSet.java:1848)
at net.sf.hibernate.type.StringType.get(StringType.java:18)
at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62)
at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53)
at net.sf.hibernate.type.AbstractType.hydrate(AbstractType.java:66)
at net.sf.hibernate.loader.Loader.hydrate(Loader.java:686)
at net.sf.hibernate.loader.Loader.loadFromResultSet(Loader.java:627)
at net.sf.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:586)
at net.sf.hibernate.loader.Loader.getRow(Loader.java:501)
at net.sf.hibernate.loader.Loader.getRowFromResultSet(Loader.java:213)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:281)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
at net.sf.hibernate.impl.SessionImpl.filter(SessionImpl.java:3523)
at net.sf.hibernate.impl.SessionImpl.filter(SessionImpl.java:3420)
at com.borders.hr.einfo.dao.impl.HibernateHelper.initializeActiveContents(HibernateHelper.java:73)
at com.borders.hr.einfo.dao.impl.DivisionMenuDAOImpl.getSubmenus(DivisionMenuDAOImpl.java:455)
at com.borders.hr.einfo.busobjs.DivisionMenuManager.getSubmenus(DivisionMenuManager.java:132)
at com.borders.hr.einfo.actions.app.PortalHelper.getSubmenusForTopLevelName(PortalHelper.java:138)
at com.borders.hr.einfo.actions.app.DisplayPortal.getMenus(DisplayPortal.java:181)
at com.borders.hr.einfo.actions.app.DisplayPortal.execute(DisplayPortal.java:89)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
at com.borders.servlet.filters.GZIPFilter.doFilter(GZIPFilter.java:52)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:696)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:641)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3107)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1425)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:92)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:556)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:606)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:979)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1064)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1498)
[9/13/07 20:36:53:121 EDT] 00000034 SystemOut O 2007-09-13 20:36:53,107 [WebContainer : 0] ERROR DivisionMenuDAOImpl - Hibernate error getting a parent menu.
net.sf.hibernate.JDBCException: Could not execute query
at net.sf.hibernate.impl.SessionImpl.filter(SessionImpl.java:3526)
at net.sf.hibernate.impl.SessionImpl.filter(SessionImpl.java:3420)
at com.borders.hr.einfo.dao.impl.HibernateHelper.initializeActiveContents(HibernateHelper.java:73)
at com.borders.hr.einfo.dao.impl.DivisionMenuDAOImpl.getSubmenus(DivisionMenuDAOImpl.java:455)
at com.borders.hr.einfo.busobjs.DivisionMenuManager.getSubmenus(DivisionMenuManager.java:132)
at com.borders.hr.einfo.actions.app.PortalHelper.getSubmenusForTopLevelName(PortalHelper.java:138)
at com.borders.hr.einfo.actions.app.DisplayPortal.getMenus(DisplayPortal.java:181)
at com.borders.hr.einfo.actions.app.DisplayPortal.execute(DisplayPortal.java:89)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
at com.borders.servlet.filters.GZIPFilter.doFilter(GZIPFilter.java:52)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:696)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:641)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3107)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1425)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:92)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:556)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:606)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:979)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1064)
|