Using a PreparedStatement that has more than 32 parameters generates java.lang.IndexOutOfBoundsException
 Technote (troubleshooting)
 
Problem(Abstract)
Using IBM® WebSphere® Application Server Version 5.0 Base or Network Deployment (ND) without any fix packs applied, the following exception is issued if a Version 5.0 data source is used with prepared statements that have more than 32 parameters:

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.setInt
(WSJdbcPreparedStatement.java:1005)
...

The exception occurs only on the second use of the prepared statement when WebSphere prepared statement caching is enabled.
 
Cause
This problem is caused by a defect that was identified in WebSphere Application Server 5.0.
 
Resolving the problem
To work around this problem, disable WebSphere-prepared statement caching.

This can be done by selecting the data source in the administrative console, and changing the Statement Cache Size property to zero. Although doing this resolves the problem, it is not recommended, because performance degrades without the benefit of prepared statement caching.

The problem is fixed in WebSphere Application Server Version 5.0.1 (Fix Pack 1) and above.

Please refer to Recommended Fixes for information about specific WebSphere Application Server fixes

 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > DB Connections/Connection Pooling
Operating system(s): Windows
Software version: 5.0
Software edition:
Reference #: 1106928
IBM Group: Software Group
Modified date: Jun 9, 2006