Skip to content

Exception translation for (H2) batchUpdate constraint violations has changed in Spring Boot 3.5.7 #2170

@advptr

Description

@advptr

When a NamedParameterJdbcTemplate.batchUpdate operation violates a data constraint, the method used to throw a DataIntegrityViolationException with a java.sql.BatchUpdateException as the cause

Since upgrading to Spring Boot 3.5.7, this behavior has changed. When using H2, a constraint violation now raises a DataIntegrityViolationException with a org.h2.jdbc.JdbcSQLDataException as the cause.

This is problematic in some cases since there's no way to identify which rows in the batch that actually failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions