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

The JdbcMetadataStore does not work well with PostgreSQL and MySQL-based vendors #9481

Closed
artembilan opened this issue Sep 17, 2024 · 0 comments

Comments

@artembilan
Copy link
Member

For more info see: https://stackoverflow.com/questions/78979169/how-can-i-ensure-that-multiple-instances-of-my-spring-integration-application-do

@artembilan artembilan added this to the 6.4.0-M3 milestone Sep 17, 2024
spring-builds pushed a commit that referenced this issue Sep 17, 2024
Fixes: #9481
Issue link: #9481

MySQL throws `CannotAcquireLockException` in case of duplicate key failure.
PostgreSQL just rollbacks a transaction not letting us move on with a `SELECT`

* Include `TransientDataAccessException` to the catch block of the `INSERT`
to ignore it for the subsequent `SELECT`
* Add logic to determine `PostgreSQL` database vendor and include `ON CONFLICT DO NOTHING`
hint into the `INSERT` to not fail in case of duplicate key found on `putIfAbsent` operation

(cherry picked from commit 98d0266)
spring-builds pushed a commit that referenced this issue Sep 17, 2024
Fixes: #9481
Issue link: #9481

MySQL throws `CannotAcquireLockException` in case of duplicate key failure.
PostgreSQL just rollbacks a transaction not letting us move on with a `SELECT`

* Include `TransientDataAccessException` to the catch block of the `INSERT`
to ignore it for the subsequent `SELECT`
* Add logic to determine `PostgreSQL` database vendor and include `ON CONFLICT DO NOTHING`
hint into the `INSERT` to not fail in case of duplicate key found on `putIfAbsent` operation

(cherry picked from commit 98d0266)
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