node-oracledb icon indicating copy to clipboard operation
node-oracledb copied to clipboard

Node-oracledb 6.0 with a 'Thin' mode has been released!

Open sharadraju opened this issue 2 years ago • 21 comments

Hello All, the node-oracledb 6.0.0 release is out!

This version of node-oracledb is now a ‘Thin’ mode driver by default. The Thin mode is implemented purely in JavaScript and connects directly to Oracle Database. It removes the need to download Oracle client libraries to connect to Oracle Database.

You can also enable a ‘Thick’ mode that will allow the optional use of Oracle client libraries with some additional functionality. This mode will include all the features of the previous node-oracledb release, along with the other enhancements.

Check out our release blog for all the deets: https://medium.com/@sharad-chandran/usher-in-a-new-era-with-the-node-oracledb-6-0-pure-javascript-thin-driver-e10e2af693b2

sharadraju avatar May 24 '23 19:05 sharadraju

good day! i can't connect to oracle db. error is "NJS-138: connections to this database server version are not supported by node-oracledb in Thin mode". my dep version is ""oracledb": "^6.0.1","

kuanysh-baltagarayev avatar Jun 08 '23 04:06 kuanysh-baltagarayev

@kuanysh-baltagarayev What is your Oracle Database version?

sharadraju avatar Jun 08 '23 05:06 sharadraju

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

kuanysh-baltagarayev avatar Jun 08 '23 05:06 kuanysh-baltagarayev

@kuanysh-baltagarayev node-oracledb 6.0 Thin mode supports Oracle Database Release 12.1 and later. Please see the following documentation: https://node-oracledb.readthedocs.io/en/latest/user_guide/appendix_a.html#id1 for the supported releases.

Node-oracledb 6.0 is a 'Thin mode' driver by default. You can switch to Thick mode for Oracle Database 11g support or upgrade your database version

sharadraju avatar Jun 08 '23 05:06 sharadraju

thank you!!!

kuanysh-baltagarayev avatar Jun 08 '23 05:06 kuanysh-baltagarayev

how about oracle 10g sir?

Fariededuction avatar Jun 13 '23 09:06 Fariededuction

@Fariededuction Oracle Database 10g can be used with node-oracledb 6.0 Thick mode and the right Oracle Client Libraries. Thin mode does not support Oracle Database 10g.

sharadraju avatar Jun 13 '23 10:06 sharadraju

wow its really work sir, thank you!!

Fariededuction avatar Jun 14 '23 01:06 Fariededuction

Hello @sharadraju I want to connect to Oracle database in Thin mode. But in typeorm i am not aware how can i do this. Can you please guide me for that.

Thanks in advance.

nilaytupelolife avatar Oct 12 '23 13:10 nilaytupelolife

@nilaytupelolife There was a bug related to the running of typeorm tests with node-oracledb 6.0, which was fixed in 6.1. You might want to follow the TypeORM PR for making the Thin mode default for node-oracledb in TypeORM here: https://github.com/typeorm/typeorm/pull/10285 Please let me know if you have connected to Oracle Database with node-oracledb earlier versions with typeorm. There should not be any change to those settings.

sharadraju avatar Oct 14 '23 05:10 sharadraju

@sharadraju Thank youfor you reply. I figure out and it is working fine. But when i do npm install it is not working i need to do -force to install packages. I am facing following error npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/oracledb npm ERR! oracledb@"^6.1.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peerOptional oracledb@"^5.1.0" from [email protected] npm ERR! node_modules/typeorm npm ERR! typeorm@"^0.3.17" from the root project npm ERR! peer typeorm@"^0.3.0" from @nestjs/[email protected] npm ERR! node_modules/@nestjs/typeorm npm ERR! @nestjs/typeorm@"^10.0.0" from the root project npm ERR! npm ERR! Conflicting peer dependency: [email protected] npm ERR! node_modules/oracledb npm ERR! peerOptional oracledb@"^5.1.0" from [email protected] npm ERR! node_modules/typeorm npm ERR! typeorm@"^0.3.17" from the root project npm ERR! peer typeorm@"^0.3.0" from @nestjs/[email protected] npm ERR! node_modules/@nestjs/typeorm npm ERR! @nestjs/typeorm@"^10.0.0" from the root project

Can you please guide me on this>

nilaytupelolife avatar Oct 15 '23 02:10 nilaytupelolife

@nilaytupelolife The latest version of node-oracledb is 6.2, which was released last week. Your package.json file must have node-oracledb 6.1 as the dependency. Change the node-oracledb version in your package.json file to ^6.2

sharadraju avatar Oct 15 '23 11:10 sharadraju

@sharadraju I did that. But now i feel, issue is because typeorm has 5.1.4 set in their peer dependencies thats why it is giving error. Can you help in that as well?

nilaytupelolife avatar Oct 15 '23 11:10 nilaytupelolife

@nilaytupelolife You might want to follow the TypeORM PR: https://github.com/typeorm/typeorm/pull/10285 Here they are updating the version of node-oracledb to 6.1 in the peer dependencies. You can comment there and request them to approve the merge of the PR.

sharadraju avatar Oct 15 '23 11:10 sharadraju

@sharadraju Thank you very much for your support. will check it in typeorm repository.

nilaytupelolife avatar Oct 15 '23 12:10 nilaytupelolife

@sharadraju I am facing listner issue when i try to connect oracle cloud db using Oracle db 6.2.0. Can you please help? I am using wallet approch earlier with 5.5.0.

nilaytupelolife avatar Oct 18 '23 10:10 nilaytupelolife

@nilaytupelolife Can you send the exact error that you are facing? The Wallet connect string details have changed with Oracle Cloud Database. So you may have to re-download your wallet and try again. Are you using mTLS or 1-way TLS?

sharadraju avatar Oct 18 '23 10:10 sharadraju

I am usign mTLS. Error is something like this NJS-521: connection to host *************** port **** is refused

nilaytupelolife avatar Oct 18 '23 10:10 nilaytupelolife

@nilaytupelolife In Thin mode, you have to specify the walletPassword as a separate attribute in the dbConfig object as well. Something like the following:

const oracledb = require('oracledb');

async function runApp() {

  let connection;
  let dbConfig = {
    user: process.env.NODE_ORACLEDB_USER,
    password: process.env.NODE_ORACLEDB_PASSWORD,
    connectString: process.env.NODE_DB_CONNECT_STRING,
    walletLocation: process.env.TNS_ADMIN,
    walletPassword: process.env.WALLET_PASSWORD,
    configDir: process.env.TNS_ADMIN,
    sslServerDNMatch: true,
    //httpsProxy: process.env.PROXY_HOST,
    //httpsProxyPort: process.env.PROXY_PORT,
  };
console.log(dbConfig);

  try {
    // Get a standalone Oracle Database connection
    //oracledb.initOracleClient();
    connection = await oracledb.getConnection(dbConfig);
    console.log('Connection was successful!');

This is documented here

sharadraju avatar Oct 18 '23 11:10 sharadraju

I am trying g to upgrade the version from 5.5.0 to 6.0.0 or 6.5.1 major version. I get an error while creating pool - NJS-516 no configuration directory set or available to search for tnsnames.ora. Not sure what's missing as it was working fine in 5.5.0.

karkan20 avatar May 24 '24 02:05 karkan20

@karkan20 please open new issues for new problems. But before doing that that, review this: https://node-oracledb.readthedocs.io/en/latest/user_guide/initialization.html#using-optional-oracle-configuration-files and note the differences between Thin mode (the new default) and Thick mode (the equivalent of what you had in 5.5)

cjbj avatar May 24 '24 03:05 cjbj