oracle / node-oracledb

Oracle Database driver for Node.js maintained by Oracle Corp.
http://oracle.github.io/node-oracledb/
Other
2.24k stars 1.07k forks source link

Error parsing tnsnames.ora file in thin mode with Easy Connect String entries #1644

Closed sosoba closed 2 months ago

sosoba commented 4 months ago
  1. What versions are you using?

6.3.0

  1. Is it an error or a hang or a crash?

Error

  1. What error(s) or behavior you are seeing?
TypeError: Cannot read properties of null (reading 'name')
    at createNode (oracledb\lib\thin\sqlnet\connStrategy.js:167:22)
    at resolveAddress (oracledb\lib\thin\sqlnet\networkSession.js:96:10)
  1. Include a runnable Node.js script that shows the problem.

tnsnames.ora:

XE = tcp://localhost/XE

test.js

import oracledb from 'oracledb';
await oracledb.getConnection({connectionString: 'XE', user: 'nobody', password: 'empty'});

The connection is established correctly via oracledb thick mode same as sqlplus, SqlDeveloper, ojdbc.

sharadraju commented 4 months ago

Thanks @sosoba . We will look at it

sreguna commented 4 months ago

Though this works in thick mode, Easy Connect entries in tnsnames.ora is not a documented feature. We will look into adding this support for thin mode.

sharadraju commented 2 months ago

This has been fixed in the 6.5 release.