Zephor Wu (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5ce270f...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNzcyOTFkZmQ5...
) / Improvement (
https://hibernate.atlassian.net/browse/HHH-16235?atlOrigin=eyJpIjoiNzcyOT...
) HHH-16235 (
https://hibernate.atlassian.net/browse/HHH-16235?atlOrigin=eyJpIjoiNzcyOT...
) ConstraintViolationException logged before being thrown (
https://hibernate.atlassian.net/browse/HHH-16235?atlOrigin=eyJpIjoiNzcyOT...
)
Issue Type: Improvement Affects Versions: 5.6.15 Assignee: Unassigned Components:
hibernate-core Created: 27/Feb/2023 22:41 PM Environment: env independent, long lived
problem Priority: Major Reporter: Zephor Wu (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5ce270f...
) Original estimate: 16h Remaining Estimate: 16h
when encountered Duplicate entry error, hibernate would log that error information before
throw it out. it really messed up the log when I have deal it in the application level.
Same question was proposed early in 2005
https://forum.hibernate.org/viewtopic.php?p=2258025 (
https://forum.hibernate.org/viewtopic.php?p=2258025 )
And I would quote the words in it to express my opinion
it is not feasible to suppress that log message, precisely because it is
at level ERROR.
If I need to insert a million records and I expect that maybe a 1000 of
them will fail, I don't want to check their existence first, I want to
catch the exception, and I don't want garbage in my logs
it is not an hibernate error if a ConstraintViolationException occurs,
Hibernate should let me decide if/how/when to log it, and not to pollute
my logs.
(
https://hibernate.atlassian.net/browse/HHH-16235#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16235#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100217- sha1:65be9f2 )