Closed bhandaribhumin closed 2 years ago
@bhandaribhumin This is interesting. Can you confirm that last comment? Can you check with both Instant Client 21.3 and 21.6?
Also make sure you don't have some conflict with differing versions in PATH and in the initOracleClient()
call.
@bhandaribhumin I asked around about this error. It's related to Kerberos. If you have kerberos5 in the authentication_services parameter of your sqlnet.ora, trying removing that. If not, can you make sure you do a clean comparison between versions of Instant Client and also node-oracledb, and let us know?
Closing - no update. Also there's no indication this is a node-oracledb driver problem.
Hi Team, I was using this node since 6 month on MacOS everything works expectedly but when i was setup same project on windows system I'm not able to run the project.
What versions are you using?
"oracledb": "^5.4.0", Node version: v16.15.0
Is it an error or a hang or a crash?
error
Error: NJS-047: poolAlias "default" not found in the connection pool cache at OracleDb.getConnection (E:\GitHub\veera\veera-api\node_modules\oracledb\lib\oracledb.js:267:13) at OracleDb. (E:\GitHub\veera\veera-api\node_modules\oracledb\lib\util.js:178:19)
at Object.simpleExecute (E:\GitHub\veera\veera-api\src\services\database.js:70:27)
at Object.select (E:\GitHub\veera\veera-api\src\db_apis\version.js:9:33)
at getVersions (E:\GitHub\veera\veera-api\src\controllers\version.js:8:34)
at Layer.handle [as handle_request] (E:\GitHub\veera\veera-api\node_modules\express\lib\router\layer.js:95:5)
at next (E:\GitHub\veera\veera-api\node_modules\express\lib\router\route.js:144:13)
at Route.dispatch (E:\GitHub\veera\veera-api\node_modules\express\lib\router\route.js:114:3)
at Layer.handle [as handle_request] (E:\GitHub\veera\veera-api\node_modules\express\lib\router\layer.js:95:5)
at E:\GitHub\veera\veera-api\node_modules\express\lib\router\index.js:284:15
const oracledb = require('oracledb'); const dbConfig = require('../config/database.js');
// Tell node-oracledb where to find the Oracle Instant Client 'Basic' package on macOS and Windows if (process.platform === 'darwin') { console.log('process.env.HOM', process.env.HOME); oracledb.initOracleClient({ libDir: process.env.HOME + '/instantclient_19_8' }); } else if (process.platform === 'win32') { // oracledb.initOracleClient({ libDir: 'C:\oracleDB\instantclient_21_3' }); // note the double backslashes oracledb.initOracleClient({ libDir: 'C:\oracle\instantclient_21_6' }); } // else you must set the system library search path before starting Node.js
async function initialize() { const DEFAULT_POOL_STRING = dbConfig.hrPool; await getOracleConnection(dbConfig.hrPool).then((resolve)=>{ console.log('resolve',resolve); }).catch((error)=>{ console.log('Error',error); }) }
const getOracleConnection = (DB_POOL_STRING) => { return new Promise(async (resolve, reject) => { const returnValues = { "DB_POOL": {}, "STATUS": '' }; console.log(
Pool String
); console.log(DB_POOL_STRING); await oracledb.createPool(DB_POOL_STRING).then((res) => { returnValues.DB_POOL = dbConfig.hrPool; returnValues.STATUS = "SUCCESS"; console.log('createPool returnValues', returnValues); resolve(returnValues); }).catch(async (error) => { console.log('createPool error', error); await getOracleConnection(dbConfig.hrPoolBK); reject(error); }); }); }