Oracle
1Z0-860 · Question #250
A developer writes an enterprise application and packages it into an .ear file. The application contains two persistence units defined at the .ear level with persistence unit names FooPU and BarPU…
The correct answer is C. PersistenceUnit(unitName="BarPU"). See the full explanation below for the reasoning.
Question
A developer writes an enterprise application and packages it into an .ear file. The application contains two persistence units defined at the .ear level with persistence unit names FooPU and BarPU. The application also contains an ejb-jar with one stateless session bean. Which code, when added to the stateless session bean class, injects an EntityManagerFactory at runtime?
Options
- APersistenceUnit
- BPersistenceContext
- CPersistenceUnit(unitName="BarPU")
- DResource(name="BarPU", type=EntityManagerFactory.class) private EntityManagerFactory emf;
How the community answered
(27 responses)- A7% (2)
- B19% (5)
- C70% (19)
- D4% (1)
Community Discussion
No community discussion yet for this question.