Hi vitesse WEI,
For me, the most important phrase to understand this part of the specs is in 4.5.2:
Accessing resource managers, enterprise beans, and the EntityManager is disallowed in the session bean methods for which the container does not have a meaningful transaction context and/or client security context.
So:
A- An
EJB Constructor doesn't have meaningful transaction context nor client security context. In his constructor, an EJB can't access anything.
B- The specs (18.2.5) says:
The timeout callback method is typically has transaction attribute REQUIRED or REQUIRES_NEW. If the transaction is rolled back, the container retries the timeout.
So it can access other EJB.
C and D- PostConstruct and PreDestroy of Stateful SB can access other EJB
but the same lifecycle callback, when implemented on a Stateless SB, can't.
I think it's because:
- In the case of Stateful SB, the creation and destruction result from an action of the user.
- In the case of Stateless SB, the creation and destruction result from a decision of the container (Pool Management).
E- A business method has meaningful transaction context or client security context.
Those two tables (in 4.4.1 and 4.5.2) are very important for the exam.
But the understanding is not very easy.
Hope it helps,
Beno�t