I ve a stateful and a singelton EJBBean.
The stateful bean uses the entity manager (injected) and calls the singelton bean. The singelton bean uses the entity manager (injected).
If i try to call the singelton bean from the stateful bean, the singelton bean doesn t get an entity manager injected.
Is it not possible to get an entity manager in both beans at the same time?
EJB Bean
@Singleton
@LocalBean
public class AllocationPlanController implements AllocationPlanControllerRemote {
@PersistenceContext
private EntityManager em;
EJB Bean 2
@Stateful
@LocalBean
public class AllocationController implements AllocationControllerRemote {
@PersistenceContext
private EntityManager em;
private Allocation allocation;
private AllocationPlan allocationPlan;
AllocationPlanController allocationPlanController = new AllocationPlanController();