Exam 2v0-7222 All QuestionsBrowse all questions from this exam
Question 18

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

    Correct Answer: A, B

    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
james2033Options: AB

Need 2 things: @EnableTransactionManagement and @Transactional .

Ancient1Options: AB

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