[jboss-user] [JBoss Seam] - SpringTransaction exception handling enhancement required
dapeng
do-not-reply at jboss.com
Tue Nov 13 15:02:43 EST 2007
Hi,
currently if a tx will be rollbacked, the SpringTransaction class kind of swallow the root cause in the following code
catch (TransactionSystemException e)
| {
| log.error("Exception cause:", e);
| throw new SystemException(e.getMessage());
| }
| catch (UnexpectedRollbackException e)
| {
| log.error("Exception cause:", e);
| throw new RollbackException(e.getMessage());
| }
It is essential to pass the whole cause exception in SystemException and RollbackException instead of only a text message.
My use case is the following:
JSF delete action method tries to delete a row in the db. When the tx commits, it discovers the row can not be deleted because of foreign key constraint. I would like to have the ConstraintViolationException wrapped in the RollbackException, so that I have a chance to handle this exception later with the exception handler.
In the current implmenetation, the RollbacklException with only text message and no cause stack will later be wrapped as an IllegalStateException, which is not helpful for exception handling at all.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104298#4104298
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104298
More information about the jboss-user
mailing list