The INSERT statement conflicted with the FOREIGN KEY constraint in process instances


Badge +15


 

Symptoms


We have encountered a strange error in smartobject, where it always failed to execute insert method and the error message in error profiles are

"Message: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_table2_Id". The conflict occurred in database "AdventureWorks", table "dbo.table1", column 'Id'. The statement has been terminated. ServiceName: AdventureWorks ServiceGuid: 55369e43-6343-47ee-b1d0-0e41986c8de6 InnerExceptionMessage: "

I have tried to execute the smartobject manually (using smartobject service tester) and it works, the data is inserted.

And the strange part is we didn't change any process or smartobject, but the error occur today not the day before.

 

Diagnoses


ServiceGuid does not match the ServiceGuid in the current environment. Most likely the process instance is trying to execute a SmartObject that is on another environment. Since the records do not exist in the other environment, the other environment's SQL Server triggered a foreign constraint error.

After checking the String Table, it was discovered that a some of the server values such as SmartObject Server, are pointing to the wrong server.
 

Resolution

In String Table and Enviroment Library, update all server connection strings that are pointing to the wrong server. Once that is done, use GoTo Activity to restart the process inctance.




 

0 replies

Be the first to reply!

Reply