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

DBCollection should not return null WriteResult on an unacknowledged write

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.0
    • Affects Version/s: 3.0.0
    • Component/s: API, Write Operations
    • None

      In 2.x, an unacknowledged write operation on DBCollection returns a WriteResult, and any access to the WriteResult properties will trigger a call to the getlasterror command on the same socket, which is likely to fail with an exception.

      In 3.x we will no longer call getlasterror, and instead DBCollection returns a null WriteResult for any unacknowledged writes. This ticket proposes to change DBCollection to be closer to 2.x: return a WriteResult, but throw an exception from all property accessors.

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: