h2database icon indicating copy to clipboard operation
h2database copied to clipboard

H2 2.1.210 Occasional NPE when doing query

Open Helen2022a opened this issue 2 years ago • 4 comments

Hi team,

We upgraded H2 to 2.1.210 in March. But since May, we found occasionally H2 will throw NPE when doing selecting instead of updating. It will happen occasionally and I can not find the rule.

I noticed that 2.1.212 fixed the following NPE issue for updating. Does it also work for select ? https://github.com/h2database/h2database/issues/3414

Our NPE log is as follows, it is in Command.java line 211 which is different from the line in above issue.

Caused by: msjava.dbpool.DBPoolSQLException: General error: "java.lang.NullPointerException"; SQL statement:

select a.xbActionId, a.xbActionLinkageId, a.actionType,     a.actionName, a.actionRequest, a.guid, a.doneBy, a.doneAt, a.xbActionCategory     from XBH2ACTION a     where a.xbActionLinkageId in (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,  [50000-210] (DataSource: xbh2Ln, Type: H2) at org.h2.message.DbException.getJdbcSQLException(DbException.java:573) at org.h2.message.DbException.getJdbcSQLException(DbException.java:496) at org.h2.message.DbException.get(DbException.java:216) at org.h2.message.DbException.convert(DbException.java:414) at org.h2.command.Command.executeQuery(Command.java:211) at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:128) at msjava.dbpool.connectionwrapper.internal.proxy.DBPoolPreparedStatementProxy.executeQuery(DBPoolPreparedStatementProxy.java:460) at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:698) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:639) ... 21 common frames omitted Caused by: java.lang.NullPointerException: null

Helen2022a avatar Jun 04 '22 06:06 Helen2022a

I noticed that 2.1.212 fixed the following NPE issue for updating. Does it also work for select ?

You didn't provide any test case for you issue and the provided stack trace in also incomplete, so it isn't possible to check is your issue the same as already fixed in 2.1.212 or it is a different one. But 2.1.210 shouldn't be normally used these days, because there is a newer release in 2.1 series of releases.

katzyn avatar Jun 04 '22 06:06 katzyn

Actually it could not always happen. So not sure if a test case could help. Also for the log, it was not completed in our service log. So could not send you a complete one. Maybe I could upgrade to one new release 2.1.212 first and see if the issue will happen again. Any restriction to use this release 2.1.212 ?

Helen2022a avatar Jun 04 '22 07:06 Helen2022a

2.1.212 doesn't introduce any new features or incompatibilities, it contains only fixes for various bugs and regressions. Also it allows longer values in character and binary strings than older 2.*.* releases.

katzyn avatar Jun 04 '22 07:06 katzyn

Got it. Then I could try this new release. Thank you.

Helen2022a avatar Jun 04 '22 07:06 Helen2022a