Valid 1Z0-898 Dumps shared by ExamDiscuss.com for Helping Passing 1Z0-898 Exam! ExamDiscuss.com now offer the newest 1Z0-898 exam dumps, the ExamDiscuss.com 1Z0-898 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com 1Z0-898 dumps with Test Engine here:
FooBean and BarBean are both EJB 3.0 stateless beans with container-managed transaction demarcation. All business methods in FooBean have transaction attribute REQUIRED, and all business methods in BarBean have transaction attribute REQUIRED_NEW. The business method foo in FooBean invokes the Business method bar in BarBean. Given: 10. Public class BarBean { 11. public void bar () { 12. throw new RuntimeException ("unexpected error . . . "); 13. }} Which is true about the method of invocation assuming execution reaches line 12?
Correct Answer: A
Explanation/Reference: The exception will be thrown within the FooBean container. A standard EJBException will be thrown. The EJBException is thrown to report that the invoked business method or callback method could not be completed because of an unexpected error (e.g. the instance failed to open a database connection). Note: Transaction Attributes A transaction attribute controls the scope of a transaction. Figure below illustrates why controlling the scope is important. In the diagram, method-A begins a transaction and then invokes method-B of Bean-2. When method-B executes, does it run within the scope of the transaction started by method-A, or does it execute with a new transaction? The answer depends on the transaction attribute of method-B. * RequiresNew Attribute If the client is running within a transaction and invokes the enterprise bean's method, the container takes the following steps: 1. Suspends the client's transaction 2. Starts a new transaction 3. Delegates the call to the method 4. Resumes the client's transaction after the method completes If the client is not associated with a transaction, the container starts a new transaction before running the method. You should use the RequiresNewattribute when you want to ensure that the method always runs within a new transaction. Reference: The Java EE 6 Tutorial, Container-Managed Transactions