Refer to the exhibit.
Assume that the application is using Spring transaction management which uses Spring AOP internally.
Choose the statement that describes what is happening when the update1 method is called? (Choose the best answer.)
A . There are 2 transactions because REQUIRES_NEW always runs in a new transaction.
B . An exception is thrown as another transaction cannot be started within an existing transaction.
C . There is only one transaction because REQUIRES_NEW will use an active transaction if one already exists.
D . There is only one transaction initiated by update1() because the call to update2() does not go through the proxy.
Answer: D
Explanation:
When using Spring transaction management with annotation-driven mode, the @Transactional annotation will be processed by a Transaction Interceptor that implements the AOP advice interface. This interceptor will be applied to the target bean through a proxy that implements the same interface as the target bean. Therefore, when a method of the target bean is called from outside, it will actually invoke the proxy method, which will delegate to the interceptor and then to the actual target method.
However, when a method of the target bean is called from within the same bean, it will not go through the proxy and thus bypass the interceptor logic. In this case, when update1() calls update2(), it will not start a new transaction as specified by REQUIRES_NEW propagation level, but rather join the existing transaction initiated by update1() itself.
Latest 2V0-72.22 Dumps Valid Version with 60 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund