I am using NodeJS and mysql library to access MySQL database.
When I establish single connection and repeatedly use it, it works fine:
global.mysql = mysql_module.createConnection({
host: config.mysql.host,
user: config.mysql.user,
password: config.mysql.password
});
When I use connection pool instead, I get ER_LOCK_WAIT_TIMEOUT errors in transactions.
global.mysql = mysql_module.createPool({
host: config.mysql.host,
user: config.mysql.user,
password: config.mysql.password,
database : config.mysql.database,
connectionLimit : 50
});
Strangely enough, the errors do occur on exactly the same data at exactly the same times.
I.e. I have