OFBiz
  1. OFBiz
  2. OFBIZ-2353

SequenceUtil may generate duplicate IDs in Load Balancing mode

    Details

      Description

      If Ofbiz is deploy on 2 servers in Load Balancing Mode
      SequenceUtil will generate duplicate IDs because synchronization is done at JVM level instead of doing it in DB.

      A good replacement implementation would be:
      org.hibernate.id.enhanced.TableGenerator

      But it would involve a dependency on Hibernate

      Philippe
      www.ubik-ingenierie.com

      1. OFBIZ-2353 SELECT FOR UPDATE solution.patch
        4 kB
        Jacques Le Roux
      2. OFBIZ-2353 SELECT FOR UPDATE solution.patch
        7 kB
        Jacques Le Roux
      3. OFBIZ-2353-AC.patch
        4 kB
        Adrian Crum
      4. OFBIZ-2353-AC.patch
        9 kB
        Adrian Crum

        Issue Links

          Activity

          Jacques Le Roux made changes -
          Fix Version/s Upcoming Branch [ 12327361 ]
          Jacques Le Roux made changes -
          Fix Version/s 13.07.01 [ 12329159 ]
          Fix Version/s Release Branch 11.04 [ 12316420 ]
          Fix Version/s Upcoming Branch [ 12327361 ]
          Jacques Le Roux made changes -
          Fix Version/s Release Branch 11.04 [ 12316420 ]
          Fix Version/s 13.07.01 [ 12327355 ]
          Jacopo Cappellato made changes -
          Fix Version/s 13.07.01 [ 12327355 ]
          Adrian Crum made changes -
          Attachment OFBIZ-2353-AC.patch [ 12665815 ]
          Adrian Crum made changes -
          Attachment OFBIZ-2353-AC.patch [ 12665792 ]
          Jacopo Cappellato made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Jacopo Cappellato made changes -
          Fix Version/s Upcoming Branch [ 12327361 ]
          Jacopo Cappellato made changes -
          Fix Version/s Trunk [ 12311928 ]
          Fix Version/s Release Branch 11.04 [ 12316420 ]
          Jacques Le Roux made changes -
          Comment [ Something which is interesting to note: SequenceBank.refresh uses SequenceBank.fillBank but leads only to (is used by) 19 references
          While SequenceBank.fillBank with SequenceBank.getNextSeqId leads to GenericDelegator.getNextSeqId which leads to 130 references where SequenceBank.refresh is not used

          {noformat}
          SequenceBank.fillBank => 3 references
              <- SequenceBank.refresh <- SequenceUtil.forceBankRefresh <- GenericDelegator.createSetNextSeqId => 19 references
              <- SequenceBank.SequenceBank <- SequenceUtil.getBank <- SequenceUtil.getNextSeqId
              <- SequenceBank.getNextSeqId <- SequenceUtil.getNextSeqId <- GenericDelegator.getNextSeqIdLong => 3 references
                  <- SequencedIdToEnv.exec (minilang)
                  <- another GenericDelegator.getNextSeqIdLong <- PartyWorker.createClubId (unused)
                  <- GenericDelegator.getNextSeqId <- another GenericDelegator.getNextSeqId => 130 references
          {noformat}

          So I think we are not talking exactly of the same thing and I'm more interested by the last GenericDelegator.getNextSeqId. ]
          Jacopo Cappellato made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Assignee Jacques Le Roux [ jacques.le.roux ] Jacopo Cappellato [ jacopoc ]
          Gavin made changes -
          Link This issue is depended upon by OFBIZ-3557 [ OFBIZ-3557 ]
          Gavin made changes -
          Link This issue blocks OFBIZ-3557 [ OFBIZ-3557 ]
          Jacques Le Roux made changes -
          Link This issue is duplicated by OFBIZ-3557 [ OFBIZ-3557 ]
          Jacques Le Roux made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Assignee Adam Heath [ doogie ] Jacques Le Roux [ jacques.le.roux ]
          Fix Version/s Release Branch 10.04 [ 12314832 ]
          Fix Version/s Release Branch 11.04 [ 12316420 ]
          Fix Version/s SVN trunk [ 12311928 ]
          Resolution Fixed [ 1 ]
          Jacques Le Roux made changes -
          Jacques Le Roux made changes -
          Link This issue blocks OFBIZ-3557 [ OFBIZ-3557 ]
          Jacques Le Roux made changes -
          Gavin made changes -
          Workflow jira [ 12461674 ] OFbiz Workflow [ 12507177 ]
          Adam Heath made changes -
          Link This issue is duplicated by OFBIZ-3557 [ OFBIZ-3557 ]
          Adam Heath made changes -
          Field Original Value New Value
          Assignee Adam Heath [ doogie ]
          Philippe Mouawad created issue -

            People

            • Assignee:
              Jacopo Cappellato
              Reporter:
              Philippe Mouawad
            • Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development