Why session bean method throw EjbTransactionRolledbackException when RuntimeException was thrown

前端 未结 2 1044
刺人心
刺人心 2021-02-10 05:38

I am trying to persist the entity with constraint validation, when invoke persist - there is constraint that thrown and the caller get EjbTransactionRolledbackException

2条回答
  •  心在旅途
    2021-02-10 06:08

    Just to integrate @Pascal's answer, it is also possible to mark Exception (if it's on your own) with

     @javax.ejb.ApplicationException(rollback = true)
     public class UncheckedException extends RuntimeException {...}
    

提交回复
热议问题