Logging in catch block

Description

I have experienced very unpleasant problem in live environment where UnsupportedOperationException appeared. It was caused by calling rollback method which is not implemented (HHH-5019). But the cause of exception was hidden in log files, because of following code:

public RuntimeException convert(RuntimeException e) {
RuntimeException result = e;
if ( e instanceof HibernateException ) {
result = convert( ( HibernateException ) e );
}
else {
markAsRollback();
}
return result;
}

My suggestion is to add in else part logger. It will do no harm and it will possible to see cause of problem in log file especially in environments where manual debugging is not possible. Thanks in advance.

Activity

Show:

Ondrej MotlikMarch 23, 2011 at 12:10 PM

Code can be found in class AbstractEntityManagerImpl

Details

Assignee

Reporter

Priority

Created March 23, 2011 at 11:52 AM
Updated March 23, 2011 at 12:10 PM

Flag notifications