Skip to content

Unique Order Id's #922

@mykehsd

Description

@mykehsd

Currently the OrderBundle\Generator\OrderNumberGenerator has a flawed implementation to retrieve the next order id. During high concurrency the identical order id will be returned for different orders. This can be resolved 3 ways,

  1. Maintain an order number table with an auto incrementing id. New order numbers will be created by executing an INSERT into that table and we would retrieve the last_increment_id of the table.
    Negatives:
    • This table could grow quite large
    • Requires auto_incrementing support
  2. Maintain an order number table that contains the last order id (single row per store). A transaction would lock the table, we'd read the value and increment it.
    Negatives:
    • Requires a row lock
  3. Random number generation would create an order id based off mt_rand()
    Negatives:
    • Does not generate a sequential order id #

I'll implement any solution, but I believe #3 is the best long term solution because it doesn't require any vendor specific support and does not expose the sequential order # (which many vendors don't want shown to end users).

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCDiscussions about potential changes or new features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions