-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Unique Order Id's #922
Copy link
Copy link
Closed
Labels
RFCDiscussions about potential changes or new features.Discussions about potential changes or new features.
Description
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,
- Maintain an order number table with an auto incrementing id. New order numbers will be created by executing an
INSERTinto that table and we would retrieve thelast_increment_idof the table.Negatives:
- This table could grow quite large
- Requires auto_incrementing support
- 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
- 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).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
RFCDiscussions about potential changes or new features.Discussions about potential changes or new features.