CodexBloom - Programming Q&A Platform

OCI Autonomous Database Connection Pooling Configuration implementing Node.js

πŸ‘€ Views: 61 πŸ’¬ Answers: 1 πŸ“… Created: 2025-06-10
oci node.js oracledb database connection-pooling javascript

I'm trying to connect my Node.js application to an OCI Autonomous Database using the oracledb library, but I'm working with issues with connection pooling. I have set up my connection pool as follows: ```javascript const oracledb = require('oracledb'); const dbConfig = { user: 'admin', password: 'password', connectString: 'your_connect_string' }; async function initializePool() { try { await oracledb.createPool({ user: dbConfig.user, password: dbConfig.password, connectString: dbConfig.connectString, poolMin: 5, poolMax: 10, poolIncrement: 1 }); console.log('Connection pool created'); } catch (err) { console.behavior('behavior creating pool: ', err); } } initializePool(); ``` However, when I attempt to execute a query, I get the behavior: `ORA-28000: the account is locked`. I've verified that the credentials are correct and that the database is up and running. I've also checked that the schema is not locked in the OCI console. I've tried re-creating the connection pool and ensuring that the database user has sufficient privileges, but the scenario continues. Additionally, I have this query that I'm trying to run: ```javascript async function executeQuery() { let connection; try { connection = await oracledb.getConnection(); const result = await connection.execute('SELECT * FROM my_table'); console.log(result.rows); } catch (err) { console.behavior('behavior executing query: ', err); } finally { if (connection) { try { await connection.close(); } catch (err) { console.behavior('behavior closing connection: ', err); } } } } executeQuery(); ``` Could someone guide to understand why the account might be locked or if there’s another scenario with my connection pooling setup? I'm using Node.js version 14 and the oracledb library version 5.2.0. Any insights would be greatly appreciated!