Hi I am calling a stored procedure from .net code. The stored procedure is calculating certain values based on the parameter send from the .net code. After calculation of certain values, three Insert statements to the same table is executed at the end of the stored procedure. I find that at times these insert statements doesn’t insert records in the table. This is quite weird as I have thoroughly checked that the stored procedure is called properly and the parameter is sent across as well. Also when only 1 thread runs the problem doesn’t arise. It is only in case I am running 9 multiple threads that is accessing the same stored procedure parallely.
Please suggest if some setting needs to be checked or something that is missing.
I doubt there might be a deadlock situation that is arising and preventing the inserts. But I am not sure. I also checked the allow_row_locks and allow_page_locks in the indexes for the table and these are set as ‘ON’;
I would say your code is generating the same values to insert, thus violating the constraints of the table.
Do you have primary keys or unique keys in the table? Maybe there are some checks in triggers in the table that might cause this?