nerdexam
Oracle

1Z0-860 · Question #92

Given : 9. @Stateful 10. @TransactionManagement(TransactionManagementType. BEAN) 11. public class FacadeBean implements Facade { 12 @EJB Business business;lnesource SessionContext ctx; 13. public…

The correct answer is B. The transactionin method doB is committed. D. An exception is thrown when calling method end Stuff. See the full explanation below for the reasoning.

Question

Given : 9. @Stateful 10. @TransactionManagement(TransactionManagementType. BEAN) 11. public class FacadeBean implements Facade { 12 @EJB Business business;lnesource SessionContext ctx; 13. public void startStuff0 throws Exception { 14. ctx.getUserTransactionQ.beginO; 15. business. doA0; 16. business. doBQ; 17.} 18. public void endStuff0 throws Exception { 19. ctx.getUserTransactionO.commit0; 11. ©stateless 12. public class BusinessBean implements Business { 13. ©Resource SessionContext ctx; 14. public void doAO { ctx.setRollbackOnlyQ; } 15. @TransactionAttributeO"ransactionAttributeType.REQUIRES_NEW) 16. public void doBQj} A client calls startStuff and endStuff subsequently. Assuming NO other transaction-related metadata, which two statements are correct? (Choose two.)

Options

  • AMethod doB is never called.
  • BThe transactionin method doB is committed.
  • CThe transactionin method doB is rolledback.
  • DAn exception is thrown when calling method end Stuff.
  • EAn exception is thrown when calling method start Stuff.

How the community answered

(15 responses)
  • B
    73% (11)
  • C
    20% (3)
  • E
    7% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-860 Practice