openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gretchen Chiaramonte <chiar...@us.ibm.com>
Subject IndexOutOfBoundsException in SQLBuffer in OpenJPA 1.3.0-SNAPSHOT-r422266:724815
Date Mon, 15 Dec 2008 19:10:16 GMT

Receiving the following stack trace using the latest 1.3.0 build:

java.lang.IndexOutOfBoundsException
	at java.util.ArrayList.get(Unknown Source)
	at org.apache.openjpa.jdbc.sql.SQLBuffer.setParameters(SQLBuffer.java:629)
	at
org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:529)
	at
org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:485)
	at
org.apache.openjpa.jdbc.sql.SelectImpl.prepareStatement(SelectImpl.java:463)
	at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:379)
	at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:339)
	at
org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:420)
	at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:230)
	at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:220)
	at
org.apache.openjpa.jdbc.meta.strats.StoreCollectionFieldStrategy.load(StoreCollectionFieldStrategy.java:629)
	at org.apache.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java:822)
	at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:682)
	at
org.apache.openjpa.kernel.DelegatingStoreManager.load(DelegatingStoreManager.java:116)
	at org.apache.openjpa.kernel.ROPStoreManager.load(ROPStoreManager.java:78)
	at
org.apache.openjpa.kernel.StateManagerImpl.loadFields(StateManagerImpl.java:2924)
	at
org.apache.openjpa.kernel.StateManagerImpl.load(StateManagerImpl.java:379)
	at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:864)

I downloaded the source for this build and traced through the execution, and
it appears to be caused by the same value getting added to the parmList
twice in 
StoreCollectionFieldStrategy.load()
The query that is being run contains one parameter in the WHERE clause, but
an ArrayList containing two (identical) parameter values is being passed to
SQLBuffer.setParameters().
The trace of StoreCollectionFieldStrategy.load() shows the parmList List
getting the parameter value added in the call to sel.wherePrimaryKey(...)
(line 608) and the value being added to the parmList again in the call to
parmList.addAll(nonFKParams) (line 614).
-- 
View this message in context: http://n2.nabble.com/IndexOutOfBoundsException-in-SQLBuffer-in-OpenJPA-1.3.0-SNAPSHOT-r422266%3A724815-tp1659513p1659513.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.


Mime
View raw message