Cayenne
  1. Cayenne
  2. CAY-482

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical 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"))); }

      }

        Activity

        Tomas Jucius created issue -
        Andrus Adamchik made changes -
        Field Original Value New Value
        Assignee Andrus Adamchik [ andrus ]
        Status Unassigned [ 1 ] Assigned [ 2 ]
        Andrus Adamchik made changes -
        Fix Version/s 1.2 [DEV] [ 10030 ]
        Hide
        Andrus Adamchik added a comment -

        I checked in a fix that increases the id pool size per millisecond to two bytes (more precisely 254^2 = 64 516). I am not in possesion of hardware that can make that many objects in 1 ms, but it is still probably worse testing the next nighly build.

        Show
        Andrus Adamchik added a comment - I checked in a fix that increases the id pool size per millisecond to two bytes (more precisely 254^2 = 64 516). I am not in possesion of hardware that can make that many objects in 1 ms, but it is still probably worse testing the next nighly build.
        Andrus Adamchik made changes -
        Resolution Fixed [ 1 ]
        Status Assigned [ 2 ] Resolved [ 5 ]
        Andrus Adamchik made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Henri Yandell made changes -
        Project Import Sat Mar 21 00:51:04 PDT 2009 [ 1237621864637 ]
        Ari Maniatis made changes -
        Workflow jira [ 12456442 ] Cayenne workflow [ 12486916 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Resolved Resolved Closed Closed
        7d 19h 57m 1 Andrus Adamchik 23/Mar/06 14:39

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development