Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-993

E11000 duplicate key error with concurrent inserts from multiple app domains

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 1.9.2
    • 1.9.1
    • BSON
    • None

    Description

      Same BSON ObjectId is sometimes generated for two different documents when inserts are performed concurrently from different .NET app domains in the same process.

      WriteConcern detected an error 'insertDocument :: caused by :: 11000 E11000 duplicate key error index: <colletionname>.$id dup key: { : ObjectId('538c82074141bd10741de97d') }'.

      My thoughts:
      The ObjectId class appears to not take application domains into account. Using pid, machine name, timestamp, & counter (local to each app domain) is apparently not enough to guarantee uniqueness. Perhaps, app domains should be part of the input.

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            njalal Nizar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: