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:
Given a set of CMT bean methods with the following transaction attributes: Method M1 = SUPPORTS Method M2 = REQUIRED Method M3 = NOT_SUPPORTED Method M4 = REQUIRES_NEW And the following method invocation sequence: Method M1 invokes Method M2 Method M2 invokes Method M3 Method M1 invokes Method M4 If Method M1 is invoked by a method that does NOT have a transaction context, which describes a possible scenario?
Correct Answer: A
Explanation/Reference: M1 has no transaction. As M2 has Required attribute it will run within a new transaction. Note: * Required Attribute If the client is running within a transaction and invokes the enterprise bean's method, the method executes within the client's transaction. If the client is not associated with a transaction, the container starts a new transaction before running the method. The Requiredattribute is the implicit transaction attribute for all enterprise bean methods running with container-managed transaction demarcation. You typically do not set the Requiredattribute unless you need to override another transaction attribute. Because transaction attributes are declarative, you can easily change them later. 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. Reference: The Java EE 6 Tutorial, Container-Managed Transactions