When you develop custom code, you should be aware that Sterling Selling and Fulfillment Foundation obtains YFS_INVENTORY_ITEM locks in the following sort order:
Item ID, Product Class and UOM
If you adopt this sort order, you should greatly minimize the chance of deadlocks.