Connection pooling - implicit connections.

43 views
Skip to first unread message

Tim Cullen

unread,
Aug 31, 2014, 6:05:39 AM8/31/14
to node-...@googlegroups.com
The guidance notes make it clear that :

However, a connection can also be implicitly established by invoking a query

If I am using pooled connections and I create a connection implicitly by calling a query, for example:

pool.query('SELECT 1 + 1 AS solution', function(err, rows, fields) {
  if (err) throw err;

  console.log('The solution is: ', rows[0].solution);
});



does that pooled connection get released implicitly when I do  db.end()?

If not how do I release() the connection as pool.release() tells me there is no such release method for pool?


Thanks for your help.

Tim

Reply all
Reply to author
Forward
0 new messages