title: NodeJS API NJS-003: invalid connection
body: <p>First, i make an API using nodejs and oracledb.
  I have 2 routes with different response time, let say route A with 10s response time and route B 1s response time. When i execute the route A followed by route B , i got the error <strong>NJS-003: invalid connection</strong> because route B finish and close the connection followed by route A.</p>
  <p>Any ideas how to solve this problem?</p>
  <p>I'm using oracle pool , getConnection and close connection every API request.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>async function DBGetData(req, res, query, params = {}) {
    try {
      connection = await oracledb.getConnection();
      connection.callTimeout = 10 * 1000; 
  
      result = await connection.execute(
        query,
        params, 
        {
          outFormat: oracledb.OUT_FORMAT_OBJECT, 
        }
      );
  
      // send query result 
      res.json({
        status: res.statusCode,
        length: result.rows.length,
        results: result.rows,
      });
    
    } catch (err) { 
      return res.status(400).json({ error: err.toString() }); 
    } finally {
      if (connection) {
        // Always close connections
        await connection.close(); 
      }
    }
  }</code></pre>
  </div>
  </div>
  </p>