【发布时间】:2016-07-20 20:39:44
【问题描述】:
我在问https://github.com/mysqljs/mysql。我有点困惑destroy 和release 在实践中之间有什么区别。考虑这样的代码:
pool.getConnection(function(err, conn)
{
if (err)
throw err;
console.log("Connected");
conn.release();
});
这将永远挂起。如果我将release 切换到destroy,程序就会终止。项目页面中的示例有这样一段代码:
connection.release();
// Don't use the connection here, it has been returned to the pool.
所以两者都像终止一样只有release 没有终止。我的问题是——那么release 有什么用呢?
【问题讨论】:
标签: mysql node.js node-mysql