Error:
Some times while generating LOT numbers by using API - INV_LOT_API_PUB.Auto_gen_lot ,will get error "Lot number can not be generated as item is being modified in other session."
though setting organization parameters as
Organization parameter - Lot number uniqueness is set to "Unique across items" (mtl_parameters.lot_number_uniqueness = 1) , and Lot number generation is set "At item level" (mtl_parameters.lot_number_generation = 2)
Cause:
Error raised: Lot number can not be generated as item is being modified in other session. (Message name: INV_LOT_GEN_ERROR)
This error is raised since a database lock could not be obtained for updating the item record with the next sequence for lot number (start_auto_lot_number)
Some times while generating LOT numbers by using API - INV_LOT_API_PUB.Auto_gen_lot ,will get error "Lot number can not be generated as item is being modified in other session."
though setting organization parameters as
Organization parameter - Lot number uniqueness is set to "Unique across items" (mtl_parameters.lot_number_uniqueness = 1) , and Lot number generation is set "At item level" (mtl_parameters.lot_number_generation = 2)
Cause:
Error raised: Lot number can not be generated as item is being modified in other session. (Message name: INV_LOT_GEN_ERROR)
This error is raised since a database lock could not be obtained for updating the item record with the next sequence for lot number (start_auto_lot_number)
Criteria for locking the item records
If the lot uniqueness is set to "Across items" and lot generation at "Item Level" ALL lot controlled items that have the same prefix (mtl_system_items_b.auto_lot_alpha_prefix) will be locked. So, you will see that the error may be raised when you are updating any of the items. The below query can be used to identify all the lot controlled items that have the same prefix.
SELECT organization_id, inventory_item_id, auto_lot_alpha_prefix , start_auto_lot_number
from mtl_system_items_b
where lot_control_code = 2 -- lot controlled item
and auto_lot_alpha_prefix = '&prefix';
from mtl_system_items_b
where lot_control_code = 2 -- lot controlled item
and auto_lot_alpha_prefix = '&prefix';