I am using node.js npm module mysql for connection with a MySQL database.
I see there is a possibility to use:
- either pool.getConnection(), connection.query() and connection.release()
- or pool.query
I have two questions regarding the second scenario.
1) Is there any automatic reconnect in case of error, lost connection while using pool.query? (is 'handle disconnect' function needed while using pool?
2) Using the first approach I can set connection.on('error', function(){...}). How to do this in the second case? (pool.on('error'...) ?)