C100DEV Drivers, Tools, Transactions, and Search Practice Question
A developer is using the MongoDB Node.js driver to perform a multi-document transaction that updates multiple collections. During testing, the transaction occasionally fails with a TransientTransactionError. What is the most appropriate way to handle this error?
⚠ Common exam trap
The trap here is thinking that MongoDB automatically retries transactions or that retrying a single operation is sufficient, when in fact the entire transaction must be retried.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Retry the entire transaction from the beginning, including starting a new session and re-executing all operations.
When a transaction fails with TransientTransactionError, the correct approach is to retry the entire transaction. This means aborting the current transaction if it is still open, starting a new session or reusing the session after aborting, and re-executing all operations. Retrying only a single operation or ignoring the error can result in partial updates or constraint violations.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Increase the transaction lifetime limit using the maxTransactionTimeMS option and continue without retrying.
Why it's wrong here
Increasing the transaction lifetime limit addresses timeouts, not transient errors. TransientTransactionError is not resolved by extending the time limit; it requires retrying the transaction. The maxTransactionTimeMS option is not even a valid driver option for this purpose; transaction lifetime is controlled by the server.
- ✓
Retry the entire transaction from the beginning, including starting a new session and re-executing all operations.
Why this is correct
TransientTransactionError indicates a temporary issue such as a write conflict or network blip. The recommended approach is to retry the entire transaction, as partial retries may lead to inconsistent state. Starting a new session ensures a clean transaction context. This is the standard pattern for handling transient errors in MongoDB transactions.
- ✗
Ignore the error and proceed, as MongoDB will automatically retry the transaction.
Why it's wrong here
MongoDB does not automatically retry multi-document transactions. The driver does not provide automatic retry for transactions; the application must implement retry logic. Ignoring the error would leave the transaction aborted or incomplete, leading to data inconsistencies and application errors.
- ✗
Retry only the failed operation within the same transaction, without aborting or restarting the transaction.
Why it's wrong here
Retrying only the failed operation is not safe because the transaction may be in an inconsistent state. TransientTransactionError often indicates that the transaction as a whole should be retried. Continuing within the same transaction could lead to duplicate writes or violated constraints. The transaction must be aborted and restarted.
About these practice questions
This C100DEV question is part of Courseiva's 259-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official MongoDB exam blueprint
This C100DEV practice question is part of Courseiva's free MongoDB certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the C100DEV exam.