How to have rollback exception reveal real Exception
posted 12 years ago
Currently I am getting the TransactionRolledbackLocalException when something goes wrong during persistence (e.g., ORA-01401: inserted value too large for column). While I can debug this fine in the logs, I would like to have my application reveal the real exception to any client that uses my SLSB. I've tried to getCause() and drill down into the exception but I never see the "real" exception. I've tried to catch the real exception, but since that's what's not being thrown, my IDE rejects that.
How can I get the "real" exception that is causing the rollback so I can send this to the client?