2v0-7222 Exam QuestionsBrowse all questions from this exam

2v0-7222 Exam - Question 18


Which two are required to use transactions in Spring? (Choose two.)

Show Answer
Correct Answer: AB

To use transactions in Spring, it is necessary to enable transaction management and specify which methods or classes should be transactional. This can be achieved by adding @EnableTransactionManagement to a Java configuration class to activate the transaction management capabilities of Spring. Furthermore, the @Transactional annotation is used to mark the classes, interfaces, or individual methods which should participate in a transaction.

Discussion

2 comments
Sign in to comment
james2033Options: AB
Feb 12, 2024

Need 2 things: @EnableTransactionManagement and @Transactional .

Ancient1Options: AB
Aug 9, 2023

A: You have to enable transaction management. B: You choose which methods/classes will be treated as transactional by using the @Transactional annotation.