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
[jpa] Do not log failure to persist item with duplicate timestamp as error #15978
Conversation
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I have only one minor comment.
...ersistence.jpa/src/main/java/org/openhab/persistence/jpa/internal/JpaPersistenceService.java
Show resolved
Hide resolved
@jlaur : anything else? |
I don't think so, only the comment already posted. I don't know if I missed anything, but I only get notifications on commits and comments, not when a comment is only marked as resolved. |
Signed-off-by: Cody Cutrer <cody@cutrer.us>
🤦 🤦 🤦 My bad. I had addressed your comment locally. And even tried to push. But re-pushing just barely I realize for some reason my local branch didn't have its upstream set, so it just gave an error, and I hadn't noticed. This makes so much more sense why there has been no action! I apologize! |
...ersistence.jpa/src/main/java/org/openhab/persistence/jpa/internal/JpaPersistenceService.java
Outdated
Show resolved
Hide resolved
No worries! Next time please don't hestitate to ping me if you think I've forgotten about your PR - it happens. 😉 |
Ping @jlaur : I think I addressed your comments. |
…persistence/jpa/internal/JpaPersistenceService.java Co-authored-by: Jacob Laursen <jacob-github@vindvejr.dk> Signed-off-by: Cody Cutrer <cody@cutrer.us>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks! Sorry again for the false starts! |
…error (openhab#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> Signed-off-by: Erik De Boeck <deboeck.erik@gmail.com>
…error (openhab#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> Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
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