Prevent Concurrency Conflicts

Checkout orchestrates multiple background operations (called calculators) on your cart. These operations modify the Cart data model—a set of related objects including WebCart, CartCheckoutSession, CartItem, and CartDeliveryGroup.

Understand concurrency to avoid errors. When multiple processes modify the Cart data model simultaneously, the result can be data inconsistencies or failed transactions.

The Cart data model uses optimistic concurrency control. Each cart has a version number that increments with every update. When an operation saves changes, the system compares the current version with the version at retrieval time. If they don't match, the operation fails—preventing stale data from overwriting recent updates.

See B2B Commerce Checkout Calculators for how calculators work and Cart Data Model for complete entity details.