Using :
- spring-boot 2.3.6.RELEASE
- spring-data-jdbc.
- postgresql
I made a simple repository, extending CrudRepository, and it works fine. For example I am able to save data using this repository.
I created a unique index on one of the columns, and expected my repository to throw a org.springframework.dao.DuplicateKeyException when trying to insert the same object twice.
However, the repo, instead, throws a org.springframework.data.relational.core.conversion.DbActionExecutionException, which has a the DuplicateKeyException has it's cause.
My configuration is pretty basic : only configuring a datasource (spring.datasource.*)
Is this a normal behavior of spring-data-jdbc to wrap the DuplicateKeyException in a DbActionExecutionException ?
I used spring-data in the past and can't recall dealing with DbActionExecutionException.