Oracle
1Z0-895 · Question #53
Given the following stateful bean: 10. @Stateful 11. @TransactionAttribute(TransactionAttributeType.SUPPORTS) 12. public class VideoBean implements video { 13. / / insert code here 14. public void…
The correct answer is C. @TransactionAttribute(transactionAttributeType.MANDATORY). See the full explanation below for the reasoning.
Question
Given the following stateful bean: 10. @Stateful 11. @TransactionAttribute(TransactionAttributeType.SUPPORTS) 12. public class VideoBean implements video { 13. / / insert code here 14. public void method () {} 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@TransactionAttribute ()
- B@transactionmanagement(TransactionAttributeType.CONTAINER)
- C@TransactionAttribute(transactionAttributeType.MANDATORY)
- D@transactionAttribute(TransactionattributeType.RECQUIRES_NEW)
How the community answered
(29 responses)- A10% (3)
- B3% (1)
- C83% (24)
- D3% (1)
Community Discussion
No community discussion yet for this question.