VMware vRealize Automation 8.x (2022) — Question 41
Which two are required to use transactions in Spring? (Choose two.)
Answer options
- A. Add @EnableTransactionManagement to a Java configuration class.
- B. Annotate a class, an interface, or individual methods requiring a transaction with the @Transactional annotation.
- C. A class must be annotated with @Service and @Transaction.
- D. A class requiring a transaction must implement the TransactionInterceptor interface.
- E. Write a Spring AOP advice to implement transactional behavior.
Correct answer: A, B
Explanation
The correct answers are A and B because @EnableTransactionManagement is necessary to enable transaction management capabilities in Spring, and @Transactional is used to specify which methods or classes require transactions. Options C, D, and E are incorrect because they do not represent mandatory requirements for using transactions in Spring.