In the ATP inventory model stored procedures are used to check the inventory availability of the item. When checking inventory availability, WebSphere Commerce checks SUM(RECEIPT.QTYONHAND-RECEIPT.QTYINPROCESS) to decide if there is an orderable quantity.
Overallocation might occur when concurrent transaction try to allocate inventory for the same item at the same time.
WCS offers the following locking mechanism to ensure that concurrent transactions do not cause overallocation:
1. If your database type is Oracle, you may add a lock to the order item specs(ITEMSPC) to control concurrent access to the RECEIPT table when inventory is allocated in OrderPrepare. To enable the flag you will need to add the following section in wc-server.xml:
<ATPInventoryPerformanceParameters lockItemSpecEnabled="true" />
2. Another option is to configure the locking to happen when AllocateInventoryCmdImpl is executed. This flag is mostly applicable when inventory is not allocated during OrderPrepare and hence the flag in #1 wont apply.
When inventory is allocated either from OrderPrepare or OrderProcess, this flag will ensure overallocation doesn't occur:
The flag below might be added as follows in wc-server.xml:
Server restart is required for both flag to take effect.