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

dapeng wang (JIRA) jira-events at lists.jboss.org
Wed Nov 14 03:39:18 EST 2007


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: Feature Request
          Components: Spring
    Affects Versions: 2.0.0.GA
            Reporter: dapeng wang
             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