I'm creating a feature that when you pass a bar code, the product of bar code is added to a table.
After that we have a button to save the data in table. For each row is necessary to generate a stamp and an insert into a table named bo, bo2 and bo3.
With the stamp of bo we will do an insert into a table named bi, bi2 and sl.
So, I created a structure to do this with promises but I have the error but it just happens when I have for example 20 rows:
<node:6796> UnhandledPromiseRejectionWarning: Unhandled promise rejection <rejection id: 13>: RequestError: Transaction <Process ID 61> was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
The connection to database is done with mssql library.
Like my function is bigger and it is necessary to show all code to you understand better the problem I put the link below of my function. http://pastebin.com/MnM6AE6a
I already changed the structure of my function but the problem continue.