tudoutiao / h2database

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

Closed database: NullPointerException instead of 'database is closed' #167

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I see the following NullPointerException (copied from rcl.trace.db):

02-23 13:55:30 jdbc[5]: SQLException
org.h2.jdbc.JdbcSQLException: Allgemeiner Fehler:
"java.lang.NullPointerException"
General error: "java.lang.NullPointerException"; SQL statement:
UPDATE rclvalues
   SET timeend=1266929202937
 WHERE state_id=7039
   AND timeend IS null [50000-129]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:317)
    at org.h2.message.DbException.get(DbException.java:157)
    at org.h2.message.DbException.convert(DbException.java:285)
    at org.h2.command.Command.executeUpdate(Command.java:218)
    at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:176)
    at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:151)
        at .... *** application specific stack trace *** ....
Caused by: java.lang.NullPointerException
    at org.h2.store.PageStore.readPage(PageStore.java:964)
    at org.h2.store.PageStore.getPage(PageStore.java:482)
    at org.h2.index.PageDataIndex.getPage(PageDataIndex.java:212)
    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:383)
    at org.h2.index.PageDataIndex.getRow(PageDataIndex.java:372)
    at org.h2.table.TableData.getRow(TableData.java:107)
    at org.h2.index.PageBtreeIndex.getRow(PageBtreeIndex.java:286)
    at org.h2.index.PageBtreeCursor.get(PageBtreeCursor.java:45)
    at org.h2.index.IndexCursor.get(IndexCursor.java:164)
    at org.h2.table.TableFilter.getValue(TableFilter.java:656)
    at org.h2.expression.ExpressionColumn.getValue(ExpressionColumn.java:166)
    at org.h2.expression.Comparison.getValue(Comparison.java:221)
    at org.h2.expression.ConditionAndOr.getValue(ConditionAndOr.java:90)
    at org.h2.expression.Expression.getBooleanValue(Expression.java:185)
    at org.h2.command.dml.Update.update(Update.java:87)
    at org.h2.command.CommandContainer.update(CommandContainer.java:70)
    at org.h2.command.Command.executeUpdate(Command.java:198)
    ... 9 more

After this exception subsequent SQL statements seem to block.

What version of the product are you using? On what operating system, file
system, and virtual machine?
* version 1.2.129
* Windows XP

Do you know a workaround?
* No

How important/urgent is the problem for you?
* I try to migrate from MySQL to H2. So if it doesn't work I can't migrate...

In your view, is this a defect or a feature request?
* Defect

Original issue reported on code.google.com by u.wiel...@gematronik.com on 23 Feb 2010 at 1:08

GoogleCodeExporter commented 8 years ago
From the stack trace it looks like the database is already closed. Could that 
be the
reason? Usually it should throw a different exception of course, so this is 
quite
strange. Do you have a reproducible test case?

Original comment by thomas.t...@gmail.com on 23 Feb 2010 at 2:07

GoogleCodeExporter commented 8 years ago
Uups, you are right. 
I did have some blocking problems in my application and after closing it I 
looked
into the rcl.trace.db....

Sorry for the noise. Please close this bug.

Original comment by u.wiel...@gematronik.com on 23 Feb 2010 at 3:10

GoogleCodeExporter commented 8 years ago
I would like to throw a better exception in this case: 'database is closed' 
instead
of a null pointer exception.

Original comment by thomas.t...@gmail.com on 26 Feb 2010 at 8:47

GoogleCodeExporter commented 8 years ago

Original comment by thomas.t...@gmail.com on 26 Feb 2010 at 8:47

GoogleCodeExporter commented 8 years ago
I forgot to update the ticket. The problem should be solved in version 1.2.131
(2010-03-05). Please tell me if not.

Original comment by thomas.t...@gmail.com on 21 Mar 2010 at 11:44