I am using db-mysql in conjunction with the generic-pool class (https://github.com/coopernurse/node-pool). However it does not appear that the disconnect call is actually closing the connection, as the RDS manager shows the number of open connections monotonically increasing, even when the disconnect calls are made. I'm using the follow code block for the pool:
pool = generic_pool.Pool({
name: 'mysql',
max: 10,
create: function(callback) {
new mysql.Database(helper.dbOpt).connect(function(err, server) {
if (err) console.log('ERROR CONNECTING TO DB FOR CXN POOL: ' + err);
//else console.log('Connected to db.');
callback(err, this);
});
},
destroy: function(db) {
db.disconnect();
}
});
I can log the destory method is being called, but disconnect() has no effect on the open connections
I am using db-mysql in conjunction with the generic-pool class (https://github.com/coopernurse/node-pool). However it does not appear that the disconnect call is actually closing the connection, as the RDS manager shows the number of open connections monotonically increasing, even when the disconnect calls are made. I'm using the follow code block for the pool:
pool = generic_pool.Pool({ name: 'mysql', max: 10, create: function(callback) { new mysql.Database(helper.dbOpt).connect(function(err, server) { if (err) console.log('ERROR CONNECTING TO DB FOR CXN POOL: ' + err); //else console.log('Connected to db.');
}, destroy: function(db) { db.disconnect(); } });
I can log the destory method is being called, but disconnect() has no effect on the open connections