2v0-7222 Exam QuestionsBrowse all questions from this exam

2v0-7222 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.)

Show Answer
Correct Answer: BC

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

4 comments
Sign in to comment
james2033Option: C
Jan 31, 2024

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

asaladino75Option: B
Mar 2, 2024

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

saJAvaOptions: BC
Jun 11, 2024

correct

2211094Options: BC
Jun 16, 2024

The correct answer is BC