Closed dotoritos-kim closed 2 years ago
stackoverflow would be a better support for this kind of question. different remarks heres :
minDelayValidation
defaulting to 500ms), no need to handle that client side. pool.query(...)
=> pool will use an idle connection, validate connection if not used for some time, do the query then release connection. that's a shortcut in order to do a single query. And to the problem : The error indicate that connection is closed. I don't know how you get that connection, but that probably is because connection reached wait_timeout timeout.
return new SqlError(msg, sql, fatal, info, sqlState, errno, additionalStack, addHeader); ^
SqlError: Cannot execute new commands: connection closed sql: ~~~ () {
text: 'Cannot execute new commands: connection closed',
sql: 'START TRANSACTION - parameters:[]',
fatal: true,
errno: 45013,
sqlState: '08S01',
code: 'ER_CMD_CONNECTION_CLOSED'
}
If I connect to the DB for a long time and use a query, the above error occurs.
Create a pool like this:
Test connection like this:
Send query like below:
And no one was using it and only the application was on. This error occurs after approximately 4 hours. It was irregular.
I need help.