Thursday, July 3, 2008

PreDestroy annotation in SCBCD 5.0

@PreDestroy as the name suggests is called when the container wants to get rid of the instance and wants to notify the bean that it is doing so. PreDestroy can be called in the method ready state.

In the case of a stateless session bean -
- if the processing has got completed and it is no longer required.

If its a stateful session bean then -
@PreDestroy happens as soon as the @Remove method gets completed.

No comments: