Rejected
Details
Assignee
UnassignedUnassignedReporter
TimTTimTBug Testcase Reminder (view)
Bug reports should generally be accompanied by a test case!
Bug Testcase Reminder (edit)
Bug reports should generally be accompanied by a test case!
Participants
AttilaAChristian BauerCVS Notification ServiceEmmanuel BernardGavinGTimTComponents
Affects versions
Priority
Minor
Details
Details
Assignee
Unassigned
UnassignedReporter
TimT
TimTBug Testcase Reminder (view)
Bug reports should generally be accompanied by a test case!
Bug Testcase Reminder (edit)
Bug reports should generally be accompanied by a test case!
Participants
AttilaA
Christian Bauer
CVS Notification Service
Emmanuel Bernard
GavinG
TimT
Components
Affects versions
Priority
Created November 10, 2004 at 11:18 PM
Updated November 18, 2004 at 7:57 PM
Resolved November 11, 2004 at 5:20 AM
Hibernate is logging errors and then throwing exceptions. Here is a sample piece of code:
catch (SQLException sqle) {
JDBCExceptionReporter.logExceptions(sqle);
throw sqle;
}
This is a software antipattern. Either log the error and don't throw the exception, or throw the exception and don't log the error. In my case, I want to catch HibernateException, and handle it myself, but I can't do that without these errors from Hibernate coming through my log. I can turn error off in my log for hibernate.util.JDBCExceptionReporter, but
a) I shouldn't have to
and
b) This causes me to lose errors where logExceptions was used properly, such as this piece of code:
catch (SQLException e) {
//noncritical, swallow and let the other propagate!
JDBCExceptionReporter.logExceptions(e);
}