which statement is true when the work() method is invoked by a client with an existing transaction context and execution reaches Line 15?

Given:
public class MyException extends Exception { }
The business interface Foo declares a method work():
1. public void work() throws MyException;
The bean class FooBean contains the following:
10. @Stateless
11. @Remote(Foo.class)
12. public class FooBean {
13. public void work() throws MyException {
14. //do some work not shown here
15. throw new MyException();
16. }
Assuming there is no deployment descriptor, which statement is true when the work() method is
invoked by a client with an existing transaction context and execution reaches Line 15?

Given:
public class MyException extends Exception { }
The business interface Foo declares a method work():
1. public void work() throws MyException;
The bean class FooBean contains the following:
10. @Stateless
11. @Remote(Foo.class)
12. public class FooBean {
13. public void work() throws MyException {
14. //do some work not shown here
15. throw new MyException();
16. }
Assuming there is no deployment descriptor, which statement is true when the work() method is
invoked by a client with an existing transaction context and execution reaches Line 15?

A.
The container does not roll back the transaction.

B.
The client receives javax.ejb.EJBTransactionRequiredException.

C.
The client receives Javax.ejb.EJBTransactionRolledbackException.

D.
The container marks the transaction for rollback by calling the EJBContext.setRollbackOnly
method.



Leave a Reply 0

Your email address will not be published. Required fields are marked *