openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daryl Stultz <da...@6degrees.com>
Subject Eager fetch leads to out of bounds error
Date Wed, 04 Nov 2009 21:07:05 GMT
Hello,

I'm wondering if anyone has seen something like this:

<openjpa-1.2.1-r752877:753278 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: 5
at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:875)
at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:774)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:982)
at org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:278)
at
org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2400)
at
org.apache.openjpa.jdbc.meta.strats.RelationFieldStrategy.loadEagerJoin(RelationFieldStrategy.java:541)
at
org.apache.openjpa.jdbc.meta.FieldMapping.loadEagerJoin(FieldMapping.java:807)
...snip
Caused by: java.lang.ArrayIndexOutOfBoundsException: 5
at
org.apache.openjpa.meta.ClassMetaData.getExtraFieldDataIndex(ClassMetaData.java:859)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:358)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initialize(JDBCStoreManager.java:278)
at
org.apache.openjpa.kernel.DelegatingStoreManager.initialize(DelegatingStoreManager.java:111)
at
org.apache.openjpa.kernel.ROPStoreManager.initialize(ROPStoreManager.java:57)
at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:894)
at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:852)
... 78 more

I'm running a query thathas a particular field added to the fetch group for
the query, something like this:

((QueryImpl) query).getFetchPlan().addField(A.class, "funkyField");

There error doesn't happen with all data sets and it doesn't happen with
other fields on the same query/class. Anyone have any clue? What is the
significance of the "5"? Can I use that as the index of field names into a
class or something?

Is there a better way to prefetch fields? (In this case a collection). Is
there a JPA (i.e. non-OpenJPA-specific) way to prefetch collections? Perhaps
I just have a major misunderstanding of fetching again.

Thanks.

-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:daryl@6degrees.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message