[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6041) Logging in catch block

Ondrej Motlik (JIRA) noreply at atlassian.com
Wed Mar 23 05:53:08 EDT 2011


Logging in catch block
----------------------

                 Key: HHH-6041
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6041
             Project: Hibernate Core
          Issue Type: Improvement
          Components: entity-manager
    Affects Versions: 3.5.3
            Reporter: Ondrej Motlik


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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list