Hi all !!! I�m just confused . I was reading HFEJB and on page 396 they say that I cannot access a CMR field in ejbCreate() , only in ejbPostCreate() . But on page 338 they say that I can access another bean in ejbCreate() . I know that this method is called in a transaction context and at this point this methods knows security information about the client , so it is safe to access a resource manager and another bean ... thanks , victor
Both statements are true. You CAN do whatever you want with other resources in ejbCreate since you're in a transactional context. However, the bean doesn't yet exist in the underlying database when ejbCreate is executing. It is created by the EJB container after ejbCreate finishes, but before ejbPostCreate starts to execute. Ergo, you should initialize CMR fields in your ejbPostCreate method.