Skip to content

Duplicate key violation gets translated to DataIntegrityViolationException instead of DuplicateKeyException when using JPA (Hibernate) [SPR-11669] #16292

@spring-projects-issues

Description

@spring-projects-issues

Kazuki Shimizu opened SPR-11669 and commented

Environment

  • JAP( Hibernate 4.2.3.Final )
  • Spring Data JPA 1.4.3.RELEASE
  • H2 Database 1.3.172 (In memory mode)
  • Java 1.7.0_51
  • Tomcat 7.0.47

DataIntegrityViolationException is occurred when violate a primary key or unique key constraint.
This behavior is specification ?
I think that should be thrown DuplicateKeyException.

When using JDBC(Mybatis3), occurred a DuplicateKeyException.

How do think?


Affects: 3.2.8

Issue Links:

Referenced from: commits spring-attic/spring-framework-issues@9a6d454, spring-attic/spring-framework-issues@d50e4b8

2 votes, 9 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: dataIssues in data modules (jdbc, orm, oxm, tx)status: bulk-closedAn outdated, unresolved issue that's closed in bulk as part of a cleaning process

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions