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

It it safe to clone() a BulkWriteOperation?

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      I'm using buk write operations and trying to make them work correctly in the event of a Primary failure.

      When my primary fails the returned BulkWriteResult is null - I'd like to run execute() again on the BulkWriteOperation but I can't because it's 'already executed'

      Whats the correct pattern here? only create bulkWriters at the last moment and stage all the insets/updates in another collection? use clone() to create a copy to use before the execute()

      How do I use this safely?

      Attachments

        Activity

          People

            Unassigned Unassigned
            john.page@mongodb.com John Page
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: