It depends on the
EJB Container's implementation. Section 4.5.1 of the ejb core specification states:
A stateless session bean instance’s life starts when the container invokes the newInstance method on the session bean class to create a new session bean instance. Next, the container injections the bean’s SessionContext, if applicable, and performs any other dependency injection as specified by metadata annotations on the bean class or by the deployment descriptor. The container then calls the PostConstruct lifecycle callback interceptor methods for the bean, if any. The container can perform the instance creation at any time—there is no direct relationship to a client’s invocation of a business method or the create method.
At any time... which may be at startup (e.g. creation of the pool, if there is one), when needed (first method invocation on that type of stateless bean) or at any other time. The important thing to remember is that you
should not assume that it gets called
immediately before the business method invocation.
[ September 21, 2008: Message edited by: Sergio Tridente ]