nerdexam
Oracle

1Z0-860 · Question #225

Given the following stateful session bean: 10. @Stateful 11. @TransactionAttributefJransactionAttributeType. SUPPORTS) 12. public class VideoBean implements Video { 13. // insert code here 14…

The correct answer is C. @TransactionAttribute(TransactionAttributeType.MANDATORY). See the full explanation below for the reasoning.

Question

Given the following stateful session bean: 10. @Stateful 11. @TransactionAttributefJransactionAttributeType. SUPPORTS) 12. public class VideoBean implements Video { 13. // insert code here 14. public void methodAO {} 15.} Assuming no other transaction-related metadata, which code can be added at Line 13 to guarantee that business method methodA will execute only if invoked with an active transaction?

Options

  • A@TransactionAttributefJ
  • B@TransactionManagement(TransactionAttributeType. CONTAINER)
  • C@TransactionAttribute(TransactionAttributeType.MANDATORY)
  • D@TransactionAttributeO"ransactionAttributeType.REQUIRES_NEW)

How the community answered

(31 responses)
  • A
    16% (5)
  • B
    3% (1)
  • C
    74% (23)
  • D
    6% (2)

Community Discussion

No community discussion yet for this question.

Full 1Z0-860 Practice