[JAVA-1435] The flag "continueOnError" doesn't work when bulk insert Created: 11/Sep/14  Updated: 11/Sep/14  Resolved: 11/Sep/14

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: 2.12.3
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Dong [X] Assignee: Ross Lawley
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MongoDB 2.6.3


Attachments: Java Source File BulkInsertTest.java    

 Description   

I used flag "continueOnError" to bulk insert, but can't successful.

The java code in the attachment.



 Comments   
Comment by Ross Lawley [ 11/Sep/14 ]

Hi Rambo,

Your example is fine and correct. The inserts do continue to take place and as per the documentation clients only receive the last error generated by the bulk insert. So you would still get an exception but inserts after the exception still take place. You can confirm this by performing a count() after your bulk insert example.

Just a friendly reminder that either the mailing list or stackoverflow are the best resources for MongoDB behaviour type questions as they will reach a larger audience. The JAVA project is specifically for driver based bugs or issues.

Regards,

Ross

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