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

Ondrej Motlik (JIRA) noreply at atlassian.com
Wed Mar 23 06:11:09 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=41831#action_41831 ] 

Ondrej Motlik commented on HHH-6041:
------------------------------------

Code can be found in class AbstractEntityManagerImpl

> 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