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

Which two annotations indicate that the transaction for a transactional test method should be committed after the test method has completed? (Choose two.)

    Correct Answer: B, C

    The annotations @Rollback(false) and @Commit both indicate that the transaction for a transactional test method should be committed after the test method has completed. @Rollback(false) is used to indicate that a transaction should not be rolled back after the test method has completed, effectively committing it. @Commit is a specific annotation that explicitly commits the transaction after the test method has completed.

Discussion
saJAvaOptions: BC

correct

asaladino75Option: B

The B answer is correct. https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/annotation/Rollback.html

james2033Option: C

@SpringJUnitConfig @Transactional(transactionManager = "txMgr") @Commit class FictitiousTransactionalTest { https://docs.spring.io/spring-framework/reference/testing/testcontext-framework/tx.html#testcontext-tx-annotation-demo

2211094Options: BC

The correct answer is BC