The processObjects call is in a (separate) transaction. You catch all RuntimeException s, divide these exceptions into two groups.
Group one: EJBException or any other exception annotated with @ApplicationException(rollback=true) container will return this exception to you.
Group Two: All other exceptions. (Basically, those exceptions that will not be automatically returned by the container :(). β The transaction will not be rolled back if you do not.
To force a rollback you can always throw new EJBException ... etc.
Also note that after @ApplicationException(rollback=true) an Exception annotated with @ApplicationException(rollback=true) , the container will cancel the current transaction, if any (EJB-Beans is in the default transaction), regardless of what you do ( catch and ignore, for example) if the Bean is annotated with @TransactionManagement(TransactionManagementType.CONTAINER) , which is used by default in EJB.
source share