Log in
Model

OrderMutex

Magento\Sales\Model\OrderMutex

What it does

OrderMutex prevents race conditions when multiple concurrent requests try to update the same order simultaneously.

It uses database row-level locking (SELECT FOR UPDATE) to ensure only one process can modify an order at a time, executing a callback within a transaction and handling rollback on errors.

Developers use this when performing critical order operations that must be atomic and thread-safe.

Public Methods

  • execute()