Upgrade H2 version 2.0.202 from 1.4.200

  1. Hi, we are trying to upgrade 2.0.202 from 1.4.200. We are getting an error related to running our tests. While persisting data we are getting below error. Any suggestions?

Caused by: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: NULL not allowed for column "***"; SQL statement:

1 answer

  • answered 2022-01-23 07:23 Evgenij Ryazanov

    You cannot use H2 2.0.202 with Hibernate ORM 5.6, because H2Dialect in Hibernate ORM produces invalid SQL for H2, H2 2.x is more restrictive and doesn't accept it by default.

    H2 2.0.204 and later versions (current version is 2.1.210) have a LEGACY compatibility mode, it can be enabled by appending ;MODE=LEGACY to JDBC URL. This mode provides some limited compatibility with old versions of H2.

    This trick shouldn't be required for Hibernate ORM 6.0 when it will be released.

    Edited

    Changes for H2 2.x.y were backported to Hibernate ORM 5.6.5.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum