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

Michael Youngstrom (JIRA) jira-events at lists.jboss.org
Fri Nov 16 16:00:20 EST 2007


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

Michael Youngstrom resolved JBSEAM-2244.
----------------------------------------

    Resolution: Done

Removed all transaction wrapping code.  Now raw Spring transaction exceptions are thrown.  Please give the latest a try to see if it and everything else still works for you.

Thanks,
Mike

> 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
>             Fix For: 2.0.1.GA
>
>
> 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