[JAVA-1156] The number of writes sent in a write command should not exceed maxWriteBatchSize Created: 26/Mar/14  Updated: 03/Apr/14  Resolved: 27/Mar/14

Status: Closed
Project: Java Driver
Component/s: Write Operations
Affects Version/s: None
Fix Version/s: 2.12.0, 3.0.0

Type: Bug Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: rc3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When connected to a 2.6 MongoDB server the driver uses write commands for the existing insert, update, and remove methods on DBCollection. For DBCollection.insert(List<DBObject), the driver needs to ensure that the number of documents sent in each insert command does not exceed the maxWriteBatchSize returned by isMaster.

Note that this is not a problem when using DBCollection.initializeOrderedBulkOperation or DBCollection.initializeUnorderedBulkOperation



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

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-1156: Properly ensure that none of the server-defined limits on the write commands are exceeded.
There is one limit for the number of items that are allowed in each command (maxWriteBatchSize from ismaster).
There is a second limit for the number of bytes in the encoded message (maxBsonObjectSize from ismaster),
with an exception for a write command containing just a single item, which is allowed to exceed this length.
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/cfaef0c85b25a2ec72941de6b9704a466780f848

Comment by Githook User [ 27/Mar/14 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-1156: Properly ensure that none of the server-defined limits on the write commands are exceeded.
There is one limit for the number of items that are allowed in each command (maxWriteBatchSize from ismaster).
There is a second limit for the number of bytes in the encoded message (maxBsonObjectSize from ismaster), with an exception for a write command containing just a single item, which is allowed to exceed that limit.
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/9f904dce43ea3d7c6d035f616f5615195f302799

Generated at Thu Feb 08 08:53:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.