1Z0-895 · Question #13
FooBean and BarBean are both EJB 3.x stateless session beans with bean-managed transaction demarcation. The business method foo in FooBean starts a UserTransaction and invokes the business method…
The correct answer is D. FooBean.foo method receives javax.transaction.TransactionRolledbackException. The transaction will roll back. *In bean-managed transaction demarcation, the code in the session or message-driven bean explicitly marks the boundaries of the transaction. Although beans with container-managed transactions require less coding, they have one limitation: When a…
Question
Options
- AFooBean.foo method receives MyAppException.
- BThe container discards the BarBean bean instance.
- CFooBean.foo method receives a javax.ejb.EJBException that wraps MyAppException.
- DFooBean.foo method receives javax.transaction.TransactionRolledbackException.
How the community answered
(61 responses)- A5% (3)
- B10% (6)
- C2% (1)
- D84% (51)
Explanation
The transaction will roll back. *In bean-managed transaction demarcation, the code in the session or message-driven bean explicitly marks the boundaries of the transaction. Although beans with container-managed transactions require less coding, they have one limitation: When a method is executing, it can be associated with either a single transaction or no transaction at all. If this limitation will make coding your bean difficult, you should consider using bean-managed transactions. Reference: The Java EE 5 Tutorial,Bean-Managed Transactions
Topics
Community Discussion
No community discussion yet for this question.