Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sharadraju opened this issue May 24, 2023 · 21 comments
Open

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

sharadraju opened this issue May 24, 2023 · 21 comments

Comments

@sharadraju
Copy link
Member

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 sharadraju pinned this issue May 24, 2023
@sharadraju sharadraju changed the title Node-oracledb 6.0 has been released! Node-oracledb 6.0 with 'Thin' mode has been released! May 24, 2023
@cjbj cjbj changed the title Node-oracledb 6.0 with 'Thin' mode has been released! Node-oracledb 6.0 with a 'Thin' mode has been released! May 25, 2023
@kuanysh-baltagarayev
Copy link

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","

@sharadraju
Copy link
Member Author

@kuanysh-baltagarayev What is your Oracle Database version?

@kuanysh-baltagarayev
Copy link

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

@sharadraju
Copy link
Member Author

sharadraju commented Jun 8, 2023

@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

@kuanysh-baltagarayev
Copy link

thank you!!!

@cjbj cjbj closed this as completed Jun 8, 2023
@cjbj cjbj reopened this Jun 8, 2023
@Fariededuction
Copy link

how about oracle 10g sir?

@sharadraju
Copy link
Member Author

@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.

@Fariededuction
Copy link

wow its really work sir, thank you!!

@nilaytupelolife
Copy link

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.

@sharadraju
Copy link
Member Author

@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: typeorm/typeorm#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.

@nilaytupelolife
Copy link

@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>

@sharadraju
Copy link
Member Author

@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

@nilaytupelolife
Copy link

@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?

@sharadraju
Copy link
Member Author

@nilaytupelolife You might want to follow the TypeORM PR: typeorm/typeorm#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.

@nilaytupelolife
Copy link

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

@nilaytupelolife
Copy link

@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.

@sharadraju
Copy link
Member Author

@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?

@nilaytupelolife
Copy link

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

@sharadraju
Copy link
Member Author

@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

@karkan20
Copy link

karkan20 commented May 24, 2024

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.

@cjbj
Copy link
Member

cjbj commented May 24, 2024

@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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants