Given: Bean A with transaction attributes of "RequiresNew" for all its methods. Bean B with transaction attributes of "Supports" for all its methods. A client having a transaction context calls a method mA() on bean A, which in turns calls a method mB() on Bean B.
Assuming all invocations are local, which of the following statements is correct if mB() encounters a system exception?
Hey, The option "The client will get a javax.ejb.EJBException but it can continue with the same transaction" does not mean that the client transaction is rolledback. I feel that it's a way of informing the client that something bad has happened during the execution of method A. Now it's upto the client to decide if it should continue the transaction it owns or not.
Srividhya, I think we discussed this question before. choice 2 confuses some times..
see, Client running/calling his methods may be in a transaction or not in a transaction and calls methods on Bean A which starts a new transaction which is TxA and you get exception in that transaction. So you just inform back the client that some thing went wrong in TxA and its upto the client to decide to roll back his transaction or not.
Client(TxC or no transaction) ------> Bean A (TxA) ------> Bean B (TxA)