Oracle
1Z0-860 · Question #22
FooBean is an EJB 3.0 session bean that can make valid use of UserTransaction. Which is guaranteed to work in an EJB container for FooBean to obtain the UserTransaclion object?
The correct answer is A. Invoke a method on a SessionContext that returns a UserTransaction object. See the full explanation below for the reasoning.
Question
FooBean is an EJB 3.0 session bean that can make valid use of UserTransaction. Which is guaranteed to work in an EJB container for FooBean to obtain the UserTransaclion object?
Options
- AInvoke a method on a SessionContext that returns a UserTransaction object.
- BPerform JNDI lookup with name "java:/UserTransaction" on an InitialContext.
- CPerform JNDI lookup with the name "jdbc/UserTransaction" on an InitialContext.
- DUse the @TransactionManagement annotation to inject an instance variable of type UserTransaction in
How the community answered
(35 responses)- A71% (25)
- B17% (6)
- C3% (1)
- D9% (3)
Community Discussion
No community discussion yet for this question.