It would be nice if one could find the cause of a transaction's being marked for rollback.
Currently one can ask an EJBContext if its rollback-only status has been set. But while debugging one may not understand exactly why the transaction has rolled back.
Nine times out of ten the root cause is a RuntimeException of some kind that was thrown and either hidden or otherwise obscured. What if EJBContext could give you this? Something like EJBContext.getRollbackException() or something similar? The idea would be that the exception in question is the reason that the transaction was marked for rollback.
It would be nice if one could find the cause of a transaction's being marked for rollback.
Currently one can ask an EJBContext if its rollback-only status has been set. But while debugging one may not understand exactly why the transaction has rolled back.
Nine times out of ten the root cause is a RuntimeException of some kind that was thrown and either hidden or otherwise obscured. What if EJBContext could give you this? Something like EJBContext.getRollbackException() or something similar? The idea would be that the exception in question is the reason that the transaction was marked for rollback.
Affected Versions
[Future version]