OFBiz
  1. OFBiz
  2. OFBIZ-3557

Enforced sequence does not work with concurrent access

    Details

    • Type: Bug Bug
    • Status: Patch Available
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Release Branch 09.04, Trunk
    • Fix Version/s: None
    • Component/s: framework
    • Labels:
      None
    • Sprint:
      Bug Crush Event - 21/2/2015

      Description

      There is a fundamental issue with enforced sequences (for orders, invoices, etc ..) and concurrency.

      For example if two users are creating an order at the same time one of them will see the creation fail with a PK error. The problem is that the "getNextXXXId" rely on the party accounting preference entity, but there is absolutely no guarantee that the last number in the sequence gets updated before another service can read it.

      This is at best very annoying when used only internally but may be unpractical for e-commerce sites.

      1. OFBIZ-3557-1.patch
        5 kB
        Adrian Crum
      2. OFBIZ-3557-2.patch
        8 kB
        Aleksey Fedorchenko

        Issue Links

          Activity

          Wickersheimer Jeremy created issue -
          Adam Heath made changes -
          Field Original Value New Value
          Link This issue duplicates OFBIZ-2353 [ OFBIZ-2353 ]
          Gavin made changes -
          Workflow jira [ 12501912 ] OFbiz Workflow [ 12507224 ]
          Adrian Crum made changes -
          Attachment OFBIZ-3557-1.patch [ 12445073 ]
          Aleksey Fedorchenko made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Aleksey Fedorchenko made changes -
          Attachment OFBIZ-3557-2.patch [ 12456162 ]
          Jacques Le Roux made changes -
          Link This issue depends on OFBIZ-2353 [ OFBIZ-2353 ]
          Joe Eckard made changes -
          Priority Major [ 3 ] Blocker [ 1 ]
          Jacques Le Roux made changes -
          Link This issue duplicates OFBIZ-2353 [ OFBIZ-2353 ]
          Jacques Le Roux made changes -
          Comment [ Thanks Jeremy,

          Hopefully, Adam who assigned 2353 to himself and marked this one as a duplicate will apply your solution or has already another one, Adam? ]
          Jacques Le Roux made changes -
          Comment [ Add a note about the duplicate link with OFBIZ-2353
          =====================================================
          Jacopo,

          I just quickly read the 1st lines of your last comment, and I think it should be noted here the relation with OFBIZ-2353 (SequenceUtil may generate duplicate IDs in Load Balancing mode). Ha, I just see that this issue is marker as its duplicate. Not sure it's completly the case because, apart maybe the SELECT FOR UPDATE solution, the solutions proposed in OFBIZ-2353 do not guarantee enforced sequences.

          Just noticed that [Adrian already reported it in a comment above|https://issues.apache.org/jira/browse/OFBIZ-3557?focusedCommentId=12870058&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12870058]. Anyway I already removed the duplicate lin ]
          Gavin made changes -
          Link This issue depends on OFBIZ-2353 [ OFBIZ-2353 ]
          Gavin made changes -
          Link This issue depends upon OFBIZ-2353 [ OFBIZ-2353 ]
          Jacopo Cappellato made changes -
          Priority Blocker [ 1 ] Major [ 3 ]
          Sharan Foga made changes -
          Sprint Bug Crush Event - 21/2/2015 [ 91 ]
          Sharan Foga made changes -
          Rank Ranked higher
          Sharan Foga made changes -
          Rank Ranked higher
          Sharan Foga made changes -
          Rank Ranked higher

            People

            • Assignee:
              Unassigned
              Reporter:
              Wickersheimer Jeremy
            • Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:

                Development

                  Agile