ilovejs / h2database

Automatically exported from code.google.com/p/h2database
0 stars 1 forks source link

NPEs thrown from MVStore in multithreaded mode when inserting rows by multiple threads #565

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
General error: "java.lang.NullPointerException"; SQL statement:
INSERT INTO WorkItem VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [50000-178]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
    at org.h2.message.DbException.get(DbException.java:167)
    at org.h2.message.DbException.convert(DbException.java:294)
    at org.h2.mvstore.db.MVTable.addRow(MVTable.java:615)
    at org.h2.command.dml.Insert.insertRows(Insert.java:157)
    at org.h2.command.dml.Insert.update(Insert.java:115)
    at org.h2.command.CommandContainer.update(CommandContainer.java:79)
    at org.h2.command.Command.executeUpdate(Command.java:254)
    at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:199)
...
Caused by: java.lang.NullPointerException
    at org.h2.store.LobStorageMap.setTable(LobStorageMap.java:241)
    at org.h2.value.ValueLobDb.link(ValueLobDb.java:246)
    at org.h2.mvstore.db.MVPrimaryIndex.add(MVPrimaryIndex.java:121)
    at org.h2.mvstore.db.MVTable.addRow(MVTable.java:611)
    ... 48 more

What steps will reproduce the problem?
- Inserting rows into table by multiple threads. All columns in the table are 
indexed. Prepared statements are used. Embedded database (not a server). 
Database parameters: ";MULTI_THREADED=TRUE;MODE=PostgreSQL". So it is 
multithreaded with MVCC.

What version of the product are you using? On what operating system, file
system, and virtual machine?
- h2-1.4.178, Windows 7, NTFS, jdk1.7.0_45

Original issue reported on code.google.com by roman.kr...@gmail.com on 10 Jun 2014 at 10:57

GoogleCodeExporter commented 9 years ago
Could you post the "create table" statement please?

Original comment by thomas.t...@gmail.com on 10 Jun 2014 at 2:41

GoogleCodeExporter commented 9 years ago
Never mind, I can reproduce the issue. I have a test case and a fix for it.

Original comment by thomas.t...@gmail.com on 10 Jun 2014 at 6:05

GoogleCodeExporter commented 9 years ago
Committed in the trunk

Original comment by thomas.t...@gmail.com on 10 Jun 2014 at 6:09

GoogleCodeExporter commented 9 years ago
Should be fixed with version 1.4.179

Original comment by thomas.t...@gmail.com on 23 Jun 2014 at 6:34