This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
On page 361 of the Core EJB specification it states that:
Discard instance means that the container must not invoke any business methods or container callbacks on the instance
Now if my Stateless session bean throws a RuntimeException this would mean that the @PostConstruct callback should not get get called:
However when I invoke the add() method the @PostConstruct method is getting called every time?
Joined: Nov 15, 2008
This is from section 12.4.2 of the EJB Core Specification.
The PreDestroy callbacks are not invoked when the bean and the interceptors are discarded as a result of such exceptions: the lifecycle callback interceptor methods in the chain should perform any necessary clean-up operations as the interceptor chain unwinds.
Is this because I am using JBoss and another Interceptor is handling the exception?