Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-943

Split large batches correctly when InsertBatch is being emulated using write commands

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Component/s: Operations
    • Labels:
      None

      Description

      The following code throws an exception when connected to a 2.6.x server:

      BsonDocument[] documents; // assume it has 10,000 documents
      var result = collection.InsertBatch(documents);

      The fluent bulk API version of the same operation does not throw an exception:

      BsonDocument[] documents; // assume it has 10,000 documents
      var bulk = collection.InitializeOrderedBulkOperation();
      foreach (var document in documents)
      {
          bulk.Insert(document);
      }
      var result = bulk.Execute();

        Attachments

          Activity

            People

            Assignee:
            rstam Robert Stam
            Reporter:
            rstam Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: