I'm facing random issue its not happen everytime. i'm using nodeJs and connection pool. and in connection we have connection limit 50. and this is happening on INSERT only.
Does nested query blocks cause this issue ??
router.post('/userUpdateProfile', (req, res) => {
let selectedSports = [1,2];
mysqlPool = mysql.createPool(mysqlConfig);
const sql1 = `call userProfileUpdate(some params);`;
mysqlPool.query(sql1, [params], (err, response) => {
const sql2 = `call userSportMapDeleteAll(?);`;
mysqlPool.query(sql1, [params], (err1, response1) => {
var sqlBlk = "INSERT INTO UserSportMapping (userId, sportId) VALUES ?";
mysqlPool.query(sqlBlk, [tempSportArray], function(bErr) {
//Here sometimes ER_LOCK_WAIT_TIMEOUT
});
});
})
}