Hi,
We have a customer that reported the following error when our
application runs a query against the H2 database (via Hibernate). The
version of H2 is 1.2.124 The stack trace is below (the actual SQL
statement below is fake but representative of the actual query - one
table, no joins, and two simple where clause conditions).
I got this customer's database file and noticed a few interesting
things:
1) I can log in to the database fine. I can reproduce the error with
this particular query but queries on other tables seem to be fine.
2) The table in question has 153 rows in it (which seems about right)-
the query "select COUNT(*) from my_table" confirms this.
3) The database server seems to be going into an infinite loop and
returning duplicate rows. For example, in the H2 web console, if I
run "select * from my_table" it returns 1000 rows which includes many
duplicates (remember there are only 153 rows in this table). However,
this is only because the console was set to return a maximum of 1000
rows. If I change it to return ALL rows, the query never comes back.
If I add any where clause whatsoever to the query, it also never
returns.
Any information that could be provided would be appreciated. Let me
know what additional information I can provide.
Thanks,
Ned
Caused by: org.h2.jdbc.JdbcSQLException: General error:
"java.lang.ArrayIndexOutOfBoundsException"; SQL statement:select
field1, field2, field3 from my_table where field1 = ? and field2 = ?
[50000-124]
at org.h2.message.Message.getSQLException(Message.java:111)
at org.h2.message.Message.convert(Message.java:288)
at org.h2.message.Message.convert(Message.java:249)
at org.h2.command.Command.executeQueryLocal(Command.java:144)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:284)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:138)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException
at org.h2.index.PageDataLeaf.getRowAt(PageDataLeaf.java:310)
at org.h2.index.PageDataLeaf.getRow(PageDataLeaf.java:427)
at org.h2.index.PageDataNode.getRow(PageDataNode.java:284)
at org.h2.index.PageDataIndex.getRow(PageDataIndex.java:377)
at org.h2.index.PageDataIndex.getRow(PageDataIndex.java:366)
at org.h2.table.TableData.getRow(TableData.java:116)
at org.h2.index.PageBtreeIndex.getRow(PageBtreeIndex.java:284)
at org.h2.index.PageBtreeCursor.get(PageBtreeCursor.java:46)
at org.h2.index.IndexCursor.get(IndexCursor.java:146)
at org.h2.table.TableFilter.getValue(TableFilter.java:650)
at org.h2.expression.ExpressionColumn.getValue(ExpressionColumn.java:
168)
at org.h2.expression.Alias.getValue(Alias.java:37)
at org.h2.command.dml.Select.queryFlat(Select.java:495)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:556)
at org.h2.command.dml.Query.query(Query.java:236)
at org.h2.command.CommandContainer.query(CommandContainer.java:82)
at org.h2.command.Command.executeQueryLocal(Command.java:142)
... 3 more
at org.h2.engine.SessionRemote.done(SessionRemote.java:522)
at org.h2.command.CommandRemote.executeQuery(CommandRemote.java:161)
at
org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:
98)
at
com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:
76)
at
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:
208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1812)
at org.hibernate.loader.Loader.doQuery(Loader.java:697)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:
259)
at org.hibernate.loader.Loader.doList(Loader.java:2232)
... 25 more
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.