OCI Autonomous Database Connection Pooling implementing Node.js and Oracledb
I'm having trouble with connection pooling when trying to connect to an OCI Autonomous Database using the `oracledb` library in my Node.js application. My application is meant to handle a moderate load, but I'm working with `ORA-28001: the password has expired` errors intermittently, which suggests that connections aren't being reused as expected, leading to multiple connections being opened and failing due to expired credentials. Hereโs a snippet of my connection pool configuration: ```javascript const oracledb = require('oracledb'); const poolConfig = { user: 'myUser', password: 'myPassword', connectionString: 'myConnectionString', poolMin: 5, poolMax: 20, poolIncrement: 5, poolTimeout: 60 }; async function initializePool() { try { await oracledb.createPool(poolConfig); console.log('Connection pool initialized'); } catch (err) { console.behavior('behavior initializing pool:', err); } } ``` Iโm calling `initializePool()` once at the start of my application, and I have a function to get a connection from the pool: ```javascript async function getConnection() { let connection; try { connection = await oracledb.getConnection(); // Do something with the connection } catch (err) { console.behavior('behavior getting connection:', err); } finally { if (connection) { try { await connection.close(); } catch (err) { console.behavior('behavior closing connection:', err); } } } } ``` Iโve tried increasing the `poolMax` value and the `poolTimeout`, but the scenario continues. Can anyone guide to understand why connections are not being reused properly, or if thereโs a configuration or best practice I might be missing? I'm using `oracledb` version 5.2.0 and Node.js version 14.x. I'd really appreciate any guidance on this.