[jbossseam-issues] [JBoss JIRA] Updated: (JBSEAM-2244) SpringTransaction doesn't pass the exception stack to the exception handler

Pete Muir (JIRA) jira-events at lists.jboss.org
Wed Nov 14 06:07:18 EST 2007

     [ http://jira.jboss.com/jira/browse/JBSEAM-2244?page=all ]

Pete Muir updated JBSEAM-2244:

               Issue Type: Bug  (was: Feature Request)
            Fix Version/s:     (was: 2.0.1.GA)
    JBoss Forum Reference: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104413#4104413
                 Assignee: Michael Youngstrom
                 Priority: Minor  (was: Major)

> SpringTransaction doesn't pass the exception stack to the exception handler
> ---------------------------------------------------------------------------
>                 Key: JBSEAM-2244
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-2244
>             Project: JBoss Seam
>          Issue Type: Bug
>          Components: Spring
>    Affects Versions: 2.0.0.GA
>            Reporter: dapeng wang
>         Assigned To: Michael Youngstrom
>            Priority: Minor
> currently if a tx will be rollbacked, the SpringTransaction class kind of swallow the root cause in the following code
> 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());
>       }	
> The problem is that the SystemException and RollbackException defined in JTA seem not to be able to take the case exception. But 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. 
> Please make the cause exception somehow accessible (ThreadLocal, or Seam Event Context), so that the error handling mechanism has a chance to do an exception handling.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list