Exam 1z0-900 All QuestionsBrowse all questions from this exam
Question 60

Give the code fragment:

And the code fragment:

The sendConfirmation() and reserve() methods should be executed in the same transactional context.

Which transaction attributes do you ensure this?

    Correct Answer: B

    In the provided code, the `@Stateless` annotation indicates that the `Warehouse` and `Shop` classes are stateless session beans, which typically implies that they use container-managed transactions. By default, enterprise beans use the `REQUIRED` transaction attribute, meaning the container will create a new transaction if none exists, or join the caller's transaction if one is already active. Hence, no additional annotations are required to ensure that the `sendConfirmation()` and `reserve()` methods are executed within the same transactional context.

Discussion
devmsalehOption: B

B is the correct answer

LeoAliothOption: B

B is correct as the transaction should already be managed automatically

orjavaOption: B

B. REQUIRED (Default) The method became part of the caller s transaction. If the caller does not have a transaction, the method runs its own transaction.