Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When orders are created at high speed (e.g. by a script, that imports customer orders from another e-commerce system), then some of orders are not created because of duplicate order number being assigned to them.

This happens because during next order number generation:

  • no tables are locked
  • the cached value (not from DB) of last created order is used


and this results in identical order numbers being returned to easy process, that requested it.

Solution

  1. use same approach as inĀ kApplication::NextResourceId
  2. don't rely on system setting cache in the process

Related Tasks