@ApplicationException(rollback=true) is not obeyed in EAP 6

Solution Verified - Updated -

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 RuntimeException is 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
  • 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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.