Fixed
Details
Assignee
Former userFormer user(Deactivated)Reporter
GreggGreggOriginal estimate
Time tracking
No time logged0.17h remainingComponents
Fix versions
Priority
Trivial
Details
Details
Assignee
Former user
Former user(Deactivated)Reporter
Gregg
GreggOriginal estimate
Time tracking
No time logged0.17h remaining
Components
Fix versions
Priority
Created September 24, 2010 at 6:07 PM
Updated March 7, 2014 at 10:09 PM
Resolved March 9, 2011 at 10:20 PM
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.