Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function closePoolAndExit() {
console.log("\nTerminating");
try {
// Get the pool from the pool cache and close it when no
// connections are in use, or force it closed after 10 seconds
await oracledb.getPool().close(10);
console.log("Pool closed");
process.exit(0);
} catch(err) {
console.error(err.message);
process.exit(1);
}
}
async function closePoolAndExit() {
console.log("\nTerminating");
try {
// Get the pool from the pool cache and close it when no
// connections are in use, or force it closed after 10 seconds
// If this hangs, you may need DISABLE_OOB=ON in a sqlnet.ora file
await oracledb.getPool().close(10);
console.log("Pool closed");
process.exit(0);
} catch(err) {
console.error(err.message);
process.exit(1);
}
}
async function closePoolAndExit() {
console.log('\nTerminating');
try {
// Get the pool from the pool cache and close it when no
// connections are in use, or force it closed after 10 seconds
// If this hangs, you may need DISABLE_OOB=ON in a sqlnet.ora file
await oracledb.getPool().close(10);
console.log('Pool closed');
process.exit(0);
} catch(err) {
console.error(err.message);
process.exit(1);
}
}
function closePoolAndExit() {
console.log("\nTerminating");
try {
// Get the pool from the pool cache and close it when no
// connections are in use, or force it closed after 10 seconds
oracledb.getPool().close(10, function(err) {
if (err)
console.error(err.message);
else
console.log("Pool closed");
process.exit(0);
});
} catch(err) {
console.error(err.message);
process.exit(1);
}
}
async function closePoolAndExit() {
console.log('\nTerminating');
try {
// Get the pool from the pool cache and close it when no
// connections are in use, or force it closed after 2 seconds
// If this hangs, you may need DISABLE_OOB=ON in a sqlnet.ora file
await oracledb.getPool().close(2);
console.log('Pool closed');
process.exit(0);
} catch(err) {
console.error(err.message);
process.exit(1);
}
}
async function closePoolAndExit() {
console.log('\nTerminating');
try {
// Get the pool from the pool cache and close it when no
// connections are in use, or force it closed after 10 seconds
// If this hangs, you may need DISABLE_OOB=ON in a sqlnet.ora file
await oracledb.getPool().close(10);
console.log('Pool closed');
process.exit(0);
} catch(err) {
console.error(err.message);
process.exit(1);
}
}
oracledb.createPool(dbConfig, function(err, pool) {
var aliasedPool;
should.not.exist(err);
pool.should.be.ok();
pool.poolAlias.should.equal(poolAlias);
aliasedPool = oracledb.getPool(poolAlias);
should.strictEqual(pool, aliasedPool);
pool.close(function(err){
should.not.exist(err);
done();
});
});
});
function() {
var poolInst = oracledb.getPool('namedPool');
should.exist(poolInst);
},
/NJS-047/,
}, function(err) {
should.not.exist(err);
var defaultPool = oracledb.getPool();
should.exist(defaultPool);
oracledb.getConnection(function(err, conn) {
should.not.exist(err);
conn.close(function(err) {
should.not.exist(err);
defaultPool.close(function(err){
should.not.exist(err);
done();
});
});
});
});
});
async function close() {
await oracledb.getPool().close();
}