Given:
9. @Stateful
10.@TransactionManagement(TransactionManagementType.BEAN)
11. public class FacadeBean implements Facade {
12 @EJB Business business; @Resource SessionContext ctx;
13. public void startstuff() throws Exception {
14. ctx.getUserTransaction().begin();
15. business.doA();
16. business.doB();
17. }
18. public void endStuff() throws Exception {
19. ctx.getUserTransaction().commit();
11. @Stateless
12. public class BusinessBean implements Business {
13. @Resource SessionContext ctx;
14. public void doA() { ctx.setRollbackOnly();}
15. @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
16. public void doB() { }
A client calls startstuff and endStuff subsequently. Assuming NO other transaction-related
metadata, which two statements are correct? (Choose two.)
A.
Method doB is never called.
B.
The transaction in method doB is committed.
C.
The transaction in method doB is rolled back.
D.
An exception is thrown when calling method endStuff.
E.
An exception is thrown when calling method startstuff.