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

Bulk insert method doesn't have clear failure contract

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.9.3
    • Component/s: Documentation
    • Labels:
      None

      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.

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

              Created:
              Updated:
              Resolved: