Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DataIntegrityViolationException instead of DuplicateKeyException as it is recommended by its Javadocs #8998

Closed
artembilan opened this issue Mar 12, 2024 · 0 comments

Comments

@artembilan
Copy link
Member

Apparently some databases don't throw a proper code to identify a DuplicateKeyException, so better to catch DataIntegrityViolationException with the same meaning.

See more info in: https://stackoverflow.com/questions/78142353/spring-integration-and-spring-batch-transaction-manager-collision

@artembilan artembilan added this to the 6.3.0-M2 milestone Mar 12, 2024
spring-builds pushed a commit that referenced this issue Mar 12, 2024
Fixes: #8998

Apparently some databases don't throw a proper code to identify a `DuplicateKeyException`, so better to catch `DataIntegrityViolationException` with the same meaning.

(cherry picked from commit 676733c)
artembilan added a commit that referenced this issue Mar 12, 2024
Fixes: #8998

Apparently some databases don't throw a proper code to identify a `DuplicateKeyException`, so better to catch `DataIntegrityViolationException` with the same meaning.

(cherry picked from commit 676733c)

# Conflicts:
#	spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/metadata/JdbcMetadataStore.java
#	spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants