-
Bug
-
Resolution: Done
-
Undefined
-
None
Before reporting an issue
[x] I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.
Area
core
Describe the bug
When retrying a transaction, Keycloak logs an error. This due to the JpaTransactionWrapper violating the either-lor-or-throw best practice, as it does both log AND throw.
https://github.com/keycloak/keycloak/issues/35047#issuecomment-2608455509
2025-01-22 14:25:47,058 ERROR [org.keycloak.transaction.JtaTransactionWrapper] (org.keycloak.models.sessions.infinispan.changes.PersistentSessionsWorker$BatchWorker) Exception during transaction operation. Request context: Non-HTTP task, Transaction: TransactionImple < ac, BasicAction: 0:ffff0afe0012:acd9:678a1500:12386 status: ActionStatus.ABORTED >
Version
main
Regression
[ ] The issue is a regression
Expected behavior
An exception should be either thrown or logged, but not both. Logging additional information in debug mode would be ok
Actual behavior
It is both logged as an error and thrown.
How to Reproduce?
See log
Anything else?
I'll prepare a PR
- links to