Courseiva

C100DEV Drivers, Tools, Transactions, and Search Practice Question

Exhibit

{
  "error": "MongoError: Transaction 1 has been aborted",
  "code": 251,
  "errorLabels": ["TransientTransactionError"]
}

Refer to the exhibit. An application receives this error during a multi-document transaction. What is the correct approach for the application developer?

⚠ Common exam trap

Candidates attempt to manually catch transient errors and write custom loops, ignoring the built-in driver helper methods specifically designed for this purpose.

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

✓

Use the driver's retry logic to perform the entire transaction again.

The error label 'TransientTransactionError' indicates that the operation failed due to a temporary state, such as a network glitch or a transient deadlock. In MongoDB, these errors are expected and should be handled by the application through a retry mechanism. Using the driver's built-in 'withTransaction' helper function is the recommended practice, as it automatically implements the necessary retry logic for these types of transient, non-permanent failures.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Terminate the application immediately and alert the database administrator.

    Why it's wrong here

    Terminating the application is excessive for a transient error. These errors are meant to be handled gracefully by the application code. A well-designed MongoDB client implementation should expect these errors and retry the transaction block, which allows the operation to proceed without manual intervention or service downtime.

  • ✗

    Retry the specific failed write operation only, outside of the transaction.

    Why it's wrong here

    Retrying a write outside the transaction violates the atomicity of the operation. If a transaction fails, the entire unit of work must be retried as a whole to ensure data integrity. Partial retries would leave the database in an inconsistent state, defeating the purpose of using multi-document transactions.

  • ✓

    Use the driver's retry logic to perform the entire transaction again.

    Why this is correct

    The 'TransientTransactionError' label explicitly tells the driver that the entire transaction can be safely retried. By wrapping the transaction logic in the 'withTransaction' method, the driver handles the retry loop, including backoff logic, effectively shielding the application from the underlying transient issues while ensuring strict data consistency.

  • ✗

    Hard-code a try-catch block to skip the transaction and log the error.

    Why it's wrong here

    Skipping the transaction entirely means the data update is lost, which is unacceptable for business-critical operations. The goal of transaction management is to ensure success or total rollback, not to ignore failed updates. Failing to retry will result in data inconsistencies that can lead to significant application bugs.

About these practice questions

Courseiva writes every C100DEV question from scratch — 259 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.