Race condition when starting up the Ofbiz Sequence Generator

XMLWordPrintable

      If JIRA is started up and the first thing it is asked to do is to concurrently generate sequences of the same table, a race condition can occur that causes the sequence generation to fail.

      The following is logged:

      2007-05-04 12:28:19,885 indexerPool-1-thread-2 ERROR [ofbiz.core.entity.SequenceUtil] [SequenceUtil.SequenceBank.fillBank] maxTries (5) reached, giving up.
      2007-05-04 12:28:19,885 indexerPool-1-thread-2 ERROR [ofbiz.core.entity.SequenceUtil] [SequenceUtil.SequenceBank.getNextSeqId] Fill bank failed, returning null
      

      The cause is that the SequenceBank.fillBank() is called from the constructor of the SequenceBank before it is assigned to the map, so multiple SequenceBanks for the same sequence can be created - and they tend to get in each other's way. Solution is to synchronise the construction of the SequenceBanks.

              Assignee:
              Jed Wesley-Smith (Inactive)
              Reporter:
              Jed Wesley-Smith (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: