[hibernate-issues] [Hibernate-JIRA] Assigned: (HHH-5590) Don't log and rethrow exceptions in AbstractFlushingEventListener

Steve Ebersole (JIRA) noreply at atlassian.com
Wed Mar 9 14:43:09 EST 2011


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole reassigned HHH-5590:
-----------------------------------

    Assignee: Gail Badner  (was: Steve Ebersole)

> Don't log and rethrow exceptions in AbstractFlushingEventListener
> -----------------------------------------------------------------
>
>                 Key: HHH-5590
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5590
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.3.2, 3.5.6, 3.6.0.CR1
>         Environment: Hibernate 3.3.2.GA
> Oracle Database 10.1.0.4.0
> JDK 1.6.0_17
>            Reporter: Gregg
>            Assignee: Gail Badner
>            Priority: Trivial
>             Fix For: 3.6.2, 4.0.0.Alpha1
>
>         Attachments: AbstractFlushingEventListener.patch, AbstractFlushingEventListener_alternative_solution.patch, AbstractFlushingEventListener_new.patch
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> For a similar issue covering logging-and-rethrowing overall, see http://opensource.atlassian.com/projects/hibernate/browse/HB-1308.  This issue covers a specific instance in order to minimize the impact on the codebase.  However, I would be all for elimination of every instance of log-and-rethrow in the codebase.
> In this particular instance, I have a table A with a foreign key referencing records in table B.  In my user interface, I give the user the ability to delete records from table B.  If the user attempts to delete a record from table B that is referred to in table A, the database throws an integrity constraint violation.  This exception is caught in AbstractFlushingEventListener.performExecutions, logged, and rethrown.  My code sees the exception and informs the user that the record cannot be deleted because it's already in use in the system.  So the exception ends up showing up in my logs (from the log.error() statement in AbstractFlushingEventListener.performExecutions) even though I'm handling it properly.  I would like the log.error() statement removed since the code propagates the exception.  Attached is a patchfile.
> I'm not including a test case because I feel the issue is so simplistic that one isn't necessary.

-- 
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