【发布时间】:2020-01-04 06:48:16
【问题描述】:
我在关闭与 Oracle 中的数据库的连接时遇到问题。 首先,我创建连接没有任何问题。
try {
console.log('Initializing database module');
await database.initialize();
} catch (err) {
console.error(err);
process.exit(1); // Non-zero failure code
}
async function initialize() {
console.log(dbConfig.hrPool);
const pool = await oracledb.createPool(dbConfig.hrPool);
}
module.exports.initialize = initialize;
当我想关闭连接时,应用程序正在等待而没有任何响应,所以我这样做是为了结束连接
try {
console.log('Closing database module');
console.log(" here 1");
await database.close();// line whit problem
console.log(" here 2");
} catch (err) {
console.log('Encountered error', e);
err = err || e;
}
async function close() {
await oracledb.getPool().close();
}
module.exports.close = close;
另请注意,我对数据库使用 vpn 连接
【问题讨论】:
标签: node.js oracle oracle-sqldeveloper node-oracledb