timoninmaxim commented on code in PR #11874: URL: https://github.com/apache/ignite/pull/11874#discussion_r1958327349
########## modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2Connection.java: ########## @@ -59,6 +65,24 @@ public class H2Connection implements AutoCloseable { this.log = log; initStatementCache(); + + // Work around the H2 bug (NPE in Session#removeLocalTempTable). + // Make sure session always contains not-null list of temp tables. + try { + Session sess = (Session)(conn.unwrap(JdbcConnection.class)).getSession(); + + RangeTable dummyTbl = new RangeTable( + sess.getDatabase().getSchema(SCHEMA_MAIN), + ValueExpression.getNull(), + ValueExpression.getNull(), + true); + + sess.addLocalTempTable(dummyTbl); Review Comment: Let's just create the collection using reflection. It will more clear, than creation/drop random table with implicit side effects. ########## modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/H2Connection.java: ########## @@ -59,6 +65,24 @@ public class H2Connection implements AutoCloseable { this.log = log; initStatementCache(); + + // Work around the H2 bug (NPE in Session#removeLocalTempTable). Review Comment: Let's provide a direct link to the H2 ticket and/or patch. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org