I am reading the EJB specification and I got confused by a contradiction from my point of view and particularly regarding the way the Container behaves when a System Exception is thrown in lifecycle callback method of Singleton Bean.
Section 12.3.1 :
A runtime exception thrown by any lifecycle interceptor callback method causes the bean instance and its interceptors to be discarded after the interceptor chain unwindsce and any associated interceptor instances are discarded (except for Singleton Beans).
Section 4.8.4 :
Errors occurring during Singleton initialization are considered fatal and must result in the discarding of the Singleton instance. Possible initialization errors include injection failure, a system exception thrown from a PostConstruct method, or the failure of a PostConstruct method container-managed transaction to successfully commit.
Unlike instances of other component types, system exceptions thrown from business methods or callbacks of a Singleton do not result in the destruction of the Singleton instance.
So, what is true according the Section 4.8.4? If a System Exception is thrown in a @PostConstruct method or the Interceptor @PostConstruct method is the Bean discarded? I have tried it throwing an EJBException and the result was that the Beans initialization failed.
More surprising was the fact, that when throwing an EJBException from a Singleton Bean Business Method, the client received the Exception and no other method was further executed. Can I assume that the Bean Instance was discarded? According to the Specification that should not have caused the destruction of the Bean Instance. What is true in both cases?