]> git.basschouten.com Git - openhab-addons.git/commit
[jpa] Do not log failure to persist item with duplicate timestamp as error (#15978)
authorCody Cutrer <cody@cutrer.us>
Tue, 30 Jan 2024 21:37:19 +0000 (14:37 -0700)
committerGitHub <noreply@github.com>
Tue, 30 Jan 2024 21:37:19 +0000 (22:37 +0100)
commit6bd0c288943a5e42f77f06fe4f0a2b694ca0206d
tree68e4c6ab664c7a76961264776c64b7c3ee5b2c44
parent07e9b4d17c028d9d724ad2f6adff985761454eb2
[jpa] Do not log failure to persist item with duplicate timestamp as error (#15978)

* [jpa] ignore EntityExistsException

in case the user manually added a UNIQUE constraint to the database,
openHAB might send duplicate timestamps.

effectively this means the first attempt is kept, while others are
dropped. as long as you're using sub-second timestamps, this shouldn't
be an issue - the state updates truly should be duplicates

Signed-off-by: Cody Cutrer <cody@cutrer.us>
bundles/org.openhab.persistence.jpa/src/main/java/org/openhab/persistence/jpa/internal/JpaPersistenceService.java