sabitri gartaula
sabitri gartaula

Reputation: 83

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:

Upvotes: 8

Views: 8764

Answers (1)

Evgenij Ryazanov
Evgenij Ryazanov

Reputation: 8188

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.

Upvotes: 10

Related Questions