Hi.
I tried using MULTI_THREADED with 1.2.127 since it came out slow, much
slower that could be disk access. However, I then got lots of NPEs from the
cache stuff (org.h2.util.CacheLRU)..
I now upgraded to 1.2.138 - which made the queries about 100 times faster -
so now the problem is largely gone.
However, the MULTI_THREADED flag still was in place after the jar-change,
and I still get errors from the same CacheLRU thing - now only other errors.
I'll paste some stack traces, but I cannot delve further into it due to time
constraints.
These are only SELECT queries.
A little about my app: It is a GUI app, displaying pictures, where the user
can scroll through a bunch of thumbnails by scrolling the scrollwheel -
where queries thus are fired off for each "knot" on the scrollwheel. When
scrolling "provocatively" up and down, I seemingly can provoke different
errors.
First I got this:
Caused by: java.lang.RuntimeException: try to add a record twice pos:6
at org.h2.message.DbException.throwInternalError(DbException.java:226)
at org.h2.util.CacheLRU.put(CacheLRU.java:93)
at org.h2.store.PageStore.getPage(PageStore.java:592)
at org.h2.index.PageDataIndex.getPage(PageDataIndex.java:211)
at org.h2.index.PageDataIndex.getRow(PageDataIndex.java:386)
at org.h2.index.PageDataIndex.getRow(PageDataIndex.java:376)
at org.h2.table.RegularTable.getRow(RegularTable.java:104)
at org.h2.index.PageBtreeIndex.getRow(PageBtreeIndex.java:285)
at org.h2.index.PageBtreeCursor.get(PageBtreeCursor.java:45)
at org.h2.index.IndexCursor.get(IndexCursor.java:207)
at org.h2.table.TableFilter.getValue(TableFilter.java:822)
at org.h2.expression.ExpressionColumn.getValue(ExpressionColumn.java:167)
at org.h2.command.dml.Select.queryFlat(Select.java:498)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:579)
at org.h2.command.dml.Query.query(Query.java:233)
at org.h2.command.CommandContainer.query(CommandContainer.java:80)
at org.h2.command.Command.executeQuery(Command.java:132)
at
org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:96)
... 14 more
Afterwards (just using the application still after the bug above), I get
this a lot:
Caused by: java.lang.RuntimeException: try to remove head
at org.h2.message.DbException.throwInternalError(DbException.java:226)
at org.h2.util.CacheLRU.removeOld(CacheLRU.java:152)
at org.h2.util.CacheLRU.removeOldIfRequired(CacheLRU.java:124)
at org.h2.util.CacheLRU.put(CacheLRU.java:102)
at org.h2.store.PageStore.getPage(PageStore.java:592)
at org.h2.index.PageDataIndex.getPage(PageDataIndex.java:211)
at org.h2.index.PageDataNode.getRow(PageDataNode.java:281)
at org.h2.index.PageDataNode.getRow(PageDataNode.java:282)
at org.h2.index.PageDataIndex.getRow(PageDataIndex.java:387)
at org.h2.index.PageDataIndex.getRow(PageDataIndex.java:376)
at org.h2.table.RegularTable.getRow(RegularTable.java:104)
at org.h2.index.PageBtreeIndex.getRow(PageBtreeIndex.java:285)
at org.h2.index.PageBtreeCursor.get(PageBtreeCursor.java:45)
at org.h2.index.IndexCursor.get(IndexCursor.java:207)
at org.h2.table.TableFilter.getValue(TableFilter.java:822)
at org.h2.expression.ExpressionColumn.getValue(ExpressionColumn.java:167)
at org.h2.expression.Comparison.getValue(Comparison.java:173)
at org.h2.expression.ConditionAndOr.getValue(ConditionAndOr.java:90)
at org.h2.expression.Expression.getBooleanValue(Expression.java:185)
at org.h2.command.dml.Select.queryFlat(Select.java:494)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:579)
at org.h2.command.dml.Query.query(Query.java:233)
at org.h2.command.CommandContainer.query(CommandContainer.java:80)
at org.h2.command.Command.executeQuery(Command.java:132)
at
org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:96)
The "add record twice" comes with different positions, 12619 came here just
now, 7.. After this have happened, it seems like the "try to remove head"
crops up often.
Here's another one (same as I got with the 1.2.127), came after the 12619
above:
Caused by: java.lang.NullPointerException
at org.h2.util.CacheLRU.removeOld(CacheLRU.java:137)
at org.h2.util.CacheLRU.removeOldIfRequired(CacheLRU.java:124)
at org.h2.util.CacheLRU.put(CacheLRU.java:102)
at org.h2.store.PageStore.getPage(PageStore.java:592)
at org.h2.index.PageDataIndex.getPageOverflow(PageDataIndex.java:196)
at org.h2.index.PageDataLeaf.getRowAt(PageDataLeaf.java:327)
at org.h2.index.PageDataLeaf.getRow(PageDataLeaf.java:425)
at org.h2.index.PageDataNode.getRow(PageDataNode.java:282)
at org.h2.index.PageDataNode.getRow(PageDataNode.java:282)
at org.h2.index.PageDataIndex.getRow(PageDataIndex.java:387)
at org.h2.index.PageDataIndex.getRow(PageDataIndex.java:376)
at org.h2.table.RegularTable.getRow(RegularTable.java:104)
at org.h2.index.PageBtreeIndex.getRow(PageBtreeIndex.java:285)
at org.h2.index.PageBtreeCursor.get(PageBtreeCursor.java:45)
at org.h2.index.IndexCursor.get(IndexCursor.java:207)
at org.h2.table.TableFilter.getValue(TableFilter.java:822)
at org.h2.expression.ExpressionColumn.getValue(ExpressionColumn.java:167)
at org.h2.expression.Comparison.getValue(Comparison.java:173)
at org.h2.expression.ConditionAndOr.getValue(ConditionAndOr.java:90)
at org.h2.expression.Expression.getBooleanValue(Expression.java:185)
at org.h2.command.dml.Select.queryFlat(Select.java:494)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:579)
at org.h2.command.dml.Query.query(Query.java:233)
at org.h2.command.CommandContainer.query(CommandContainer.java:80)
at org.h2.command.Command.executeQuery(Command.java:132)
at
org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:96)
... 14 more
Here's a very preliminary theory from my side: This typically happens when I
literally scroll the wheel up and down, up and down, repeat... What happens
in this case, is that MY image-cache is filled "from the bottom" and "from
the top", repeatedly, resulting in the same queries being fired
alternatively, as in Z, Y, X - A, B, C - Z, Y, X - A, B, C.. So maybe the
cache literally is raced with the same keys. There is probably some
unsynchronized access to that LRU cache?
Here's another one, possibly more serious (remember, still just SELECT
queries here):
Caused by: org.h2.jdbc.JdbcSQLException: File corrupted while reading
record: "type: 135". Possible solution: use the recovery tool; SQL
statement:
SELECT * FROM xyz_data
WHERE ueid IN ('1768731b3768548d9bc18cb25ef148b0',
'c92983bf06df5dea9205808d4a83681d', '86c9e03b601154a3aa63071e87c4b1a0',
'1ed3da5c4fc35545a416177ca8cbda71', 'a694ef7f351750ac9e9f6ce0d2e5f6a4',
'f443597fcc3f5bb49cffda79f1c3c218', '4f521ede1d895d058ff97dd35079e606',
'210f731707b95ccda957df521d756790', 'd222049205d95bd28a30213c480288a3',
'bc17742f68345d5f8011e8e41a32b2bc', 'caf13c6f868d54e09d1ceaf0b9496c04',
'd2cfc8011a8e5f1fb185f6c02f9aabd3', '3b693e8185db5f568abd2e23d509f885',
'6e0642958bfe50a993b6914e8420260e', '35c5acd440765b01a9e4f7b0163eb265',
'19db0b62fae7548f807954ac356cc120', 'fb2de10016da54b2bc718bb11bb9a07b',
'76b71b6a98715572b5fa46066a2ac3ef', '9aa89910ecec5212a8c77572a0cb80b0',
'0e5162af6daf5141b7bfb423f2185221', '27c02c58f06c5c7fbddf1e71b0a734ec',
'b9b456523fa85ca5a6b5511ca2ab65cd', '5990d9cb9e9d53aba98aff4bc4b1e70a',
'e745802c3e1b5e66b0a828449e25303f', 'bffa9055d34459668c863d73b7a441e7',
'd3612cdece0a5f0fa65e94745ec84f34', '9a05dccba6575d6597ece566b9d933b1')
[90030-138]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.get(DbException.java:144)
at org.h2.store.Data.readValue(Data.java:767)
at org.h2.index.PageBtreeIndex.readRow(PageBtreeIndex.java:337)
at org.h2.index.PageBtree.getRow(PageBtree.java:168)
at org.h2.index.PageBtree.find(PageBtree.java:110)
at org.h2.index.PageBtreeLeaf.find(PageBtreeLeaf.java:268)
at org.h2.index.PageBtreeNode.find(PageBtreeNode.java:300)
at org.h2.index.PageBtreeNode.find(PageBtreeNode.java:300)
at org.h2.index.PageBtreeIndex.find(PageBtreeIndex.java:169)
at org.h2.index.PageBtreeIndex.find(PageBtreeIndex.java:160)
at org.h2.index.IndexCursor.find(IndexCursor.java:259)
at org.h2.index.IndexCursor.nextCursor(IndexCursor.java:234)
at org.h2.index.IndexCursor.next(IndexCursor.java:217)
at org.h2.table.TableFilter.next(TableFilter.java:338)
at org.h2.command.dml.Select.queryFlat(Select.java:492)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:579)
at org.h2.command.dml.Query.query(Query.java:233)
at org.h2.command.CommandContainer.query(CommandContainer.java:80)
at org.h2.command.Command.executeQuery(Command.java:132)
at
org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:96)
at
org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:643)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)
... 12 more
Kind regards,
Endre.
--
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.