Files
spring-integration/spring-integration-jdbc/src
Artem Bilan 665f6bfb69 GH-3282: Fix JdbcMetadataStore for DuplicateKeyEx (#3285)
* GH-3282: Fix JdbcMetadataStore for DuplicateKeyEx

Fixes: https://github.com/spring-projects/spring-integration/issues/3282

The `INSERT INTO ... SELECT ... FROM ... HAVING` may fail with
`DuplicateKeyException` in between transactions.
* Catch `DuplicateKeyException` from in the `tryToPutIfAbsent()`
and return `0` as a fact of not inserted to let other logic to work
as expected.

There is no test coverage for this since it is almost impossible to
reproduce such a race condition on DB

**Cherry-pick to 5.3.x & 5.2.x**

* * Remove misleading message in the comment sentence
2020-05-20 14:45:45 -04:00
..