Svetlin Zarev created TOMEE-2051:
------------------------------------

             Summary: JTA 1.2 compliance: @Transactional.rollbackOn regression
                 Key: TOMEE-2051
                 URL: https://issues.apache.org/jira/browse/TOMEE-2051
             Project: TomEE
          Issue Type: Bug
            Reporter: Svetlin Zarev


We introduced a regression with (I guess)  TOMEE-2049.

Test cases:
Transnational bean methods:

{code}
//[1] Does not work - transaction is not marked for roll back
    @Transactional(rollbackOn = RollBackException.class)
    public void withRollBackOnWithDeclaredRuntimeException() throws 
RollBackException {
        throw new RollBackException("Roll back because of me! - exception 
declared in throws clause");
    }

//[2]Works as expected
    @Transactional(rollbackOn = RollBackException.class)
    public void withRollBackOnWithoutDeclaredRuntimeException() {
        throw new RollBackException("Roll back because of me! - exception not 
declared in throws clause");
    }
{code}

Where RollbackException is a **RuntimeException**.

In the case where the runtime exception is declared in the throws clause, the 
transaction is not rolled back, although rollbackOn=RollbackException is set.




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to