Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-482

there can be only 254 ids created *within the same millisecond

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.2 branch
    • Fix Version/s: 1.2 branch
    • Component/s: Core Library
    • Labels:
      None

      Description

      Good catch! I found what the problem is - there can be only 254 ids
      created within the same millisecond. The test below fails with a
      message "Failed on 254":

      public void testIdPool() throws Exception {
      Set idSet = new HashSet();
      for (int i = 0; i < Integer.MAX_VALUE; i++)

      { assertTrue("Failed on " + i, idSet.add(new ObjectId ("Artist"))); }

      }

      While a slightly modified test succeeds (ok I only waited till 100000
      ids and canceled the test)

      public void testIdPool() throws Exception {
      Set idSet = new HashSet();
      for (int i = 0; i < Integer.MAX_VALUE; i++)

      { Thread.sleep(1); assertTrue("Failed on " + i, idSet.add(new ObjectId ("Artist"))); }

      }

        Attachments

          Activity

            People

            • Assignee:
              andrus Andrus Adamchik
              Reporter:
              entirer Tomas Jucius
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: