Troubleshooting
Problem
Attempts to run manageInventoryNodeControl Api in multi-threaded mode leads to the YFC0001 error - Record already exists in the database in IBM Sterling Selling and Fulfillment Suite.
Symptom
The log comprises of the below error:
<Errors>
<Error ErrorCode="YFC0001"
ErrorDescription="Record already exists in the database."
ErrorRelatedMoreInfo="" ErrorUniqueExceptionId="10.12.228.5315083994341400000000000002">
<Attribute Name="ErrorCode" Value="YFC0001"/>
<Attribute Name="ErrorDescription" Value="Record already exists in the database."/>
<Attribute Name="SQLState" Value="23000"/>
<Attribute Name="TableName" Value="YFS_INVENTORY_NODE_CONTROL"/>
<Attribute Name="DBErrorCode" Value="1"/>
<Attribute Name="SQLStatement" Value="PREPARED STATEMENT - INSERT /*YANTRA*/ INTO YFS_INVENTORY_NODE_CONTROL(INVENTORY_NODE_CONTROL_KEY,ORGANIZATION_CODE,NODE_CONTROL_TYPE,NODE_KEY,ITEM_ID,UOM,PRODUCT_CLASS,INV_PIC_INCORRECT_TILL_DATE,START_DATE,CREATETS,MODIFYTS,CREATEUSERID,MODIFYUSERID,CREATEPROGID,MODIFYPROGID,LOCKID) values ( '201710190750319210118700','NIKEUS','ON_HOLD','BRD','19200273','EACH',' ','2017-10-20T13:50:31','2017-10-19T00:00:00','2017-10-19T07:50:30','2017-10-19T07:50:30','FFUpdatesJMSServer','FFUpdatesJMSServer','FFUpdatesJMSServer','FFUpdatesJMSServer',0 ) "/>
<Attribute Name="TransactionIsolationLevel" Value="2"/>
<Error
ErrorCode="java.sql.SQLIntegrityConstraintViolationException"
ErrorDescription="" ErrorRelatedMoreInfo="ORA-00001: unique constraint (DOM.YFS_INV_NODE_CTRL_I1) violated
">
<Stack>java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (DOM.YFS_INV_NODE_CTRL_I1) violated
Cause
manageInventoryNodeControl API cannot be designed to acquire lock on a record/entity and then try to insert the node control
Diagnosing The Problem
The primary role of this API is to insert node control for item node. If one of the transaction was successful in inserting the record, the second transaction may fail with YFC0001 error.
Resolving The Problem
Enhancing the API to support multi thread by introducing object lock will be a over kill on performance which is not required.
A viable solution will be to handle this exception in a custom code as the item node is already marked invalid and record already exist in the DB.
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg22015777