@ApplicationException(rollback=true) is not obeyed in EAP 6
Issue
-
ApplicationException(rollback=true)not obeyed by the EJB container -
We have stateless session bean annotated with
@Stateless(name = "ExampleService")
@Interceptors({ExampleSpringBeanAutowiringInterceptor.class,
DebugEJBInterceptor.class})
@Local(ExampleServiceInt.class)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class ExampleServiceEJB {
// methods
}
-
We observe the behavior, that
- When
RuntimeExceptionis thrown from any method, stateless session bean is destroyed and transaction is rolled back - When an exception annotated with
javax.ejb.ApplicationException(rollback=false)is thrown, rollback does not occur and bean is not destroyed - When an exception annotated with
javax.ejb.ApplicationException(rollback=true)is thrown, rollback does not occur and bean is not destroyed
- When
-
We believe that the last point above is against the EJB 3.1 spec (section 14.2.1), which clearly states rollback should happen. We haven't found any way to do a rollback but prevent bean from destroying on exception.
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.