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

ObjectId does not follow the BSON ObjectId specification

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 1.2
    • Component/s: None
    • Labels:
      None

      The BSON ObjectId specification declares that the ObjectID is a 12-byte value consisting of a 4-byte timestamp, a 3-byte machine id, a 2-byte process id, and a 3-byte counter (http://www.mongodb.org/display/DOCS/Object+IDs)
      The Java ObjectId constructors treat the 12-byte buffer as 3 4-bite integers - time, machine, inc. The 2-byte process id is not taken into consideration.
      While time is initialized correctly, the other two values are wrong. This is especially critical for the compareTo method which fails in cases where the two ObjectId timestamps are equal and the inc part is used for comparison.

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            drorbr Dror Bereznitsky
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: