Bean-managed transactions obtains UserTransaction object via EJBContext using getUserTransaction() method

Q.  Which case of a session bean obtains the UserTransaction object via the EJBContext using the getUserTransaction() method in EJB transaction management?
- Published on 19 Oct 15

a. Bean-managed transactions
b. Container-managed transactions
c. Both A & B
d. None of the above

ANSWER: Bean-managed transactions
 

    Discussion

  • Nirja Shah   -Posted on 14 Dec 15
    - How you gain access to UserTransaction objects varies depending on the type of client. Enterprise JavaBeans provides two types of transaction management:
    Container-managed transactions.
    - As the name implies, the EJB container makes the decisions (based on the deployment descriptor's trans-attribute setting) regarding how to bundle operations into transactions and then works with the transaction manager, which manages the transaction processing.

    Bean-managed transactions.
    - In this case, a session bean obtains the UserTransaction object via the EJBContext using the getUserTransaction() method.

Post your comment / Share knowledge


Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)