[CSHARP-943] Split large batches correctly when InsertBatch is being emulated using write commands Created: 31/Mar/14  Updated: 02/Apr/15  Resolved: 31/Mar/14

Status: Closed
Project: C# Driver
Component/s: Operations
Affects Version/s: 1.9
Fix Version/s: 1.9

Type: Bug Priority: Major - P3
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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();



 Comments   
Comment by Githook User [ 31/Mar/14 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@10gen.com'}

Message: CSHARP-943: Added more unit tests.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/8be8f88f944ebd1621b3341b0f2281b5cd3fb492

Comment by Githook User [ 31/Mar/14 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@10gen.com'}

Message: CSHARP-943: Split large batches correctly when InsertBatch is being emulated using write commands.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/5064821fe49e45a653965542946b90ddfbaada74

Generated at Wed Feb 07 21:38:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.