I have a application and i use the Websphere DataSource and hence try to cache the prepared statements.
The statements get cached and work fine, but the default value for the Statement pool size is 10 and my application only works fine if the size is made 5. With value 10 the values being saved in the modules display the following error :
[2/3/04 17:46:33:719 GMT+05:30] 67beeed7 ExceptionUtil E CNTR0020E: Non-application exception occurred while processing method "updatePatient" on bean "BeanId(RenalNet5.2_2Feb#RenalNetEJB.jar#CMSSession, null)". Exception data: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java(Compiled Code))
at java.util.ArrayList.set(ArrayList.java:343)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.countParameter(WSJdbcPreparedStatement.java:355)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.setString(WSJdbcPreparedStatement.java:1206)
at com.ibm.db.db.base.DatabaseStringField.setFieldObject(DatabaseStringField.java)
at com.ibm.db.db.base.DatabaseTypeField.setObject(DatabaseTypeField.java)
at com.ibm.db.db.base.DatabaseResultTable.setInputValues(DatabaseResultTable.java)
at com.ibm.db.db.base.DatabaseResultTable.executeUpdate(DatabaseResultTable.java)
at com.ibm.db.db.SQLStatement.execute(SQLStatement.java)
at com.ibm.db.beans.DBModify.execute(DBModify.java)
at com.renalnet.cms.daos.PatientDAO.savePatient(PatientDAO.java:367)
at com.renalnet.cms.beans.CMSSessionBean.updatePatient(CMSSessionBean.java:250)
at com.renalnet.cms.beans.EJSRemoteStatelessCMSSession_ca99daf9.updatePatient(EJSRemoteStatelessCMSSession_ca99daf9.java:704)
at com.renalnet.cms.beans._CMSSession_Stub.updatePatient(_CMSSession_Stub.java:484)
at com.renalnet.cms.actions.MaintainPatientsAction.save(MaintainPatientsAction.java:421)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:480)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:258)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:76)
at com.renalnet.services.AuthenticationFilter.doFilter(AuthenticationFilter.java:58)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:863)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:491)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:173)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:199)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:114)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:187)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:331)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:432)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:343)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:592)
[2/3/04 17:46:33:750 GMT+05:30] 67beeed7 RequestProces W org.apache.struts.action.RequestProcessor Unhandled Exception thrown: class java.rmi.ServerException
[2/3/04 17:46:33:750 GMT+05:30] 67beeed7 WebGroup E SRVE0026E: [Servlet Error]-[RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: ; nested exception is:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0]: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: ; nested exception is:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
java.rmi.RemoteException: ; nested exception is:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
----- Begin backtrace for detail
java.rmi.RemoteException: ; nested exception is:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
----- Begin backtrace for detail
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
---------------------------------------------------------------------------
This exception does not occur with the pool size as 5
can anybody explain why this happens or suggest a solution
My Inferance:
The cache size is fixed and more the number of prepared statements the lesser will be the parameters each of the statement can cache. hence the statements with lesser parameters execute, whereas the statements with around 50 parameters cannot be accomedated. but, 10 statements with 10 parameters each can be accomedated.