Hi.
Faced to the common problem of NullPointerException on opening database 
after a forced stop.

Configuration:
1)Win 7 x64
2) Java 7
3) EclipseLink 2.6
4) H2 1.4.190 via Maven 
5) Program that writes and reads fro/from db about 1 times per minute 

Steps to reproduce:
1) try to kill all javaw processes OR try to reboot or poweroff the machine
2) try to run programm normally

In the very beginning the program on the common SELECT fails with  

2017-02-21 10:01:51,262 ERROR - general error
javax.persistence.PersistenceException: Exception [EclipseLink-4002] (
Eclipse Persistence Services - 2.6.0.v20150309-bf26070): org.eclipse.
persistence.exceptions.DatabaseException
Internal Exception: org.h2.jdbc.JdbcSQLException: ?????????? ??????: 
"java.lang.NullPointerException"
General error: "java.lang.NullPointerException"; SQL statement:
SELECT DISTINCT t1.ID, t1.PROBEDATETIME, t1.STATUS, t1.TYPE, t1.
CONTROLPOINT_ID, t1.USER_ID, t0.ID, t0.ACTIVE, t0.ALARM, t0.CALL, t0.
CURRENTNORMATIVELOWERBOUND, t0.CURRENTNORMATIVEUPPERBOUND, t0.DECIMALVALUE, 
t0.STATUSVALUE, t0.STRINGVALUE, t0.PROBE_ID, t0.PARAMETER_ID FROM     PROBE 
t1 LEFT OUTER JOIN PROBEPARAMETERRESULT t0 ON (t0.PROBE_ID = t1.ID)  WHERE 
((t1.PROBEDATETIME >= ?) AND (t1.PROBEDATETIME < ?)) ORDER BY t1.PROBEDATETIME 
DESC [50000-190]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
    at org.h2.message.DbException.get(DbException.java:168)
    at org.h2.message.DbException.convert(DbException.java:295)
    at org.h2.command.Command.executeQuery(Command.java:208)
    at org.h2.server.TcpServerThread.process(TcpServerThread.java:320)
    at org.h2.server.TcpServerThread.run(TcpServerThread.java:159)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
    at org.h2.value.Value.compareTo(Value.java:945)
    at org.h2.engine.Database.areEqual(Database.java:333)
    at org.h2.result.ResultTempTable.find(ResultTempTable.java:307)
    at org.h2.result.ResultTempTable.addRow(ResultTempTable.java:151)
    at org.h2.result.ResultTempTable.addRows(ResultTempTable.java:170)
    at org.h2.result.LocalResult.addRow(LocalResult.java:289)
    at org.h2.command.dml.Select.queryFlat(Select.java:543)
    at org.h2.command.dml.Select.queryWithoutCache(Select.java:643)
    at org.h2.command.dml.Query.query(Query.java:322)
    at org.h2.command.dml.Query.query(Query.java:290)
    at org.h2.command.dml.Query.query(Query.java:36)
    at org.h2.command.CommandContainer.query(CommandContainer.java:90)
    at org.h2.command.Command.executeQuery(Command.java:196)
    ... 3 more

Error Code: 50000

If we try to open the DB in DBeaver or Squirrel it opens, but fails on the 
same query with the same error. 
So I belive it's not a problem with JPA or Java code,

We tried different configs: TCP, embedded mode, RETENTION_TIME=0, 
WRITE_DELAY=0 - still the same

The issue raises only after forced shutdown or when db process was killed. 
On clean database and clean exit everything works as expected. 

The solution to clear 'undoLog', provided here, does not work for us (

Any thoughts will be highly appreciated. 
Thanks in advance.
--
Dmitry







-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to