mariano / node-db-mysql

MySQL database bindings for Node.js
http://nodejsdb.org
150 stars 30 forks source link

disconnect call not closing connection for Amazon RDS db #92

Open mehult opened 11 years ago

mehult commented 11 years ago

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