I am writing a nodejs application and want to use a connection pool.
However, the following application does not exit - although I expect it to finish after calling connection.end()
An application works very well if I use one connection instead of a pool. Do I need to somehow terminate the pool?
Used library : https://github.com/felixge/node-mysql
node.js version : 0.10.4 on Ubuntu
var mysql = require('mysql'); var pool = mysql.createPool({ host : 'example.org', user : 'myuser', password : 'youbet', database : 'notrevealingdetails', insecureAuth: true }); function getCampaignData(callback) { pool.getConnection(function(err, connection) { if(err) throw err; connection.query( 'SELECT cam.id, cam.name AS campaign_name, cam.subdomain, usr.email, usr.display_name AS user_displayname ' + 'FROM campaigns AS cam INNER JOIN users AS usr ON usr.id = cam.user_id ' + 'WHERE cam.state=2', function(err, rows) { callback(err, rows,connection);
source share