Oracle
1Z0-860 · Question #135
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 @Transaction Management annotation to inject an instance variable of type UserTransaction in
How the community answered
(37 responses)- A84% (31)
- B8% (3)
- C3% (1)
- D5% (2)
Community Discussion
No community discussion yet for this question.