1Z0-895-JPN Free Dumps Study Materials
Question 4: FooBean と BarBean はビーン管理トラン ザクション境界で両方の EJB3.x ステートレスセ
ッションビーンです。FooBean のビジネスメ ソッド foo は UserTransaction を開始し、 ブリ ー
ンのビジネスメソッドバーを起動します。
Given: このメソッド呼 び出しはコントロールがラン 12 に到達す ることを予想される結果
とは何ですか。
A. FooBean.foo メソッ ドは MyAppException を受けます。
B. コンテナはバービ カンビーンンスタンスを破棄します。
C. FooBean.foo メソッ ドは MyAppException をラップする javax.ejb.EJBException を受けま す。
D. FooBean.foo メソッ ドは javax.transaction.TransactionRolledbackException を受けます。
Correct Answer: D
Explanation:
The transaction will roll back.
Note:
* 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