Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-717

Bulk insert method doesn't have clear failure contract

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Works as Designed
    • 2.9.3
    • None
    • Documentation
    • None

    Description

      The JavaDoc for the bulk insert method does not describe the method's postconditions on failure: is the collection unchanged, or might the insertion have succeeded partially? In the latter case, the operation cannot be retried as-is, because there's no way to determine which documents were inserted and which were not.

      Ideally, the method should succeed or fail atomically – otherwise, bulk insert becomes a lot less useful. However, in the event that that behavior can't fit with Mongo's typical transactional behavior, then the operation should throw some subclass of MongoException that identifies which documents were inserted and which were not.

      Without an ability to identify and respond to failures, this method is not useful in a production system.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              eh-matching-mongo eHarmony Matching
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: