Interview Questions

For EJB applications with bean-managed transaction demarcations ...

BEA WebLogic Questions and Answers


(Continued from previous question...)

For EJB applications with bean-managed transaction demarcations ...

For EJB applications with bean-managed transaction demarcations, which of the following is used by the client to get a reference to the UserTransaction object for the WebLogic Server domain?
a. JTA
b. JNDI
c. JMS
d. JTS
e. JMX


Choice B is correct. WebLogic Server supports the javax.transaction package and the javax.transaction.xa package, which implement the Java Transaction API (JTA) for Java applications.
javax.transaction.UserTransaction provides an interface to the transaction manager that allows the application developer to manage the scope of a transaction explicitly. The client application uses JNDI to obtain an object reference to the UserTransaction object for the WebLogic Server domain.
The code used by the client is given.
UserTransaction ut=(UserTransaction)jndicontext.lookup("javax.transaction.UserTransaction")
If a bean needs a reference to the UserTransaction object, it obtains it from the EJBContext as given.
UserTransaction ut=ejbContext.getUserTransaction()

(Continued on next question...)

Other Interview Questions