How to use the oracledb.getPool function in oracledb

To help you get started, we’ve selected a few oracledb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oracle / node-oracledb / examples / webappawait.js View on Github external
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);
  }
}
github oracle / oracle-db-examples / javascript / node-oracledb / webappawait.js View on Github external
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);
  }
}
github oracle / node-oracledb / examples / connectionpool.js View on Github external
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);
  }
}
github oracle / node-oracledb / examples / webapp.js View on Github external
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);
  }
}
github oracle / node-oracledb / examples / blobhttp.js View on Github external
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);
  }
}
github oracle / oracle-db-examples / javascript / node-oracledb / connectionpool.js View on Github external
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);
  }
}
github oracle / node-oracledb / test / poolCache.js View on Github external
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();
        });
      });
    });
github oracle / node-oracledb / test / poolCache.js View on Github external
function() {
            var poolInst = oracledb.getPool('namedPool');
            should.exist(poolInst);
          },
          /NJS-047/,
github oracle / node-oracledb / test / poolCache.js View on Github external
}, 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();
            });
          });
        });
      });
    });