I'm trying to make a transaction(in the node code with mysql npm package) that will select from a table and see if there is a record it will update (UPDATE) otherwise to create a new record (INSERT). I'm using connection pooling build-in with 'npm mysql2' and I get interrupts between the logic of the transaction and its caused me a deadlock from the DB. is there something to do if i don't want to create a stored procedure that will make the transaction instead?
Asked
Active
Viewed 115 times
0
-
How are you doing a transaction? – Ayzrian Nov 14 '21 at 17:14
-
Please provide enough code so others can better understand or reproduce the problem. – Community Nov 16 '21 at 11:28