I'm curious if there are any hooks into the handling of runtime exceptions that propagate up through an EJB. The default behavior is to rollback a transaction and log the error. What I would like to be able to do is add my own custom logging here to add additional information on errors.
Let me back up and present the problem. Sometimes I get a hibernate runtime exception, which logs a stacktrace showing a series of "caused by's", until finally reaching something like this:
Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into some_table... was aborted. Call getNextException to see the cause.