Closed jonesy-b-dev closed 8 months ago
@jonesy-b-dev Thanks for testing node-oracledb. Node-oracledb 6.0 and later versions come with a default Thin mode. That is why the client version returns undefined. You can enable Thick mode and test it out. Have you used earlier versions of node-oracledb?
Thanks for the response @sharadraju !
Still having some issues with enabling Thick mode
i added the following line to my code on line 3
oracledb.initOracleClient({ libDir: 'D:\\Oracle' });
This should be the path to my instant client dir. (my tnsnames.ora
is located in subfolders of this folder) But I get an error saying it cannot locate the Client library.
I checked my env variables on windows and also don't see a PATH variable for oracledb. Could this be the issue?
Not sure how to correctly add the env variable though.
And no I have no used earlier versions of node-oracledb, today is the first time working with it for me.
You shouldn't need thick mode for this scenario. A "hang" can occur because of a lock -- possibly because of an earlier attempt that is still "running". You can check the database by looking at the dba_locks table. You can also simply create a brand new table and adjust the procedure to insert into it instead. Finally, you can set the environment variable NODE_ORACLEDB_DEBUG_PACKETS to any value and run your script again. I suspect the "hang" is occurring after the request has been sent to the database. If you see a response from the database (received packet) then something else is going on!
Ok so this is weird.
Started up this morning and tested the code. It works. So me happy happy.
I make one chance (pasted in the other implementation to see if that works too).
And it stopped working, same problem, I run node connection.js
to run the file and it hangs, no output and console it taken so have to ctrl c out of it.
So I was from ok whatever so I ctrl z to the implementation that did work, and guess what it stopped working. Same issue.
Is there some kind of bug I discovered?
I checked the table DBA_LOCKS
and its empty.
I will try changing the procedure to add to another new table now.
Greets
@anthony-tuininga @sharadraju I found a fix for it, I just have to recompile the procedure every time its been used. I will close the issue now, thanks for the help
That should not be necessary. It suggests a missing commit somewhere. Hopefully you find a better solution in time!
yeah, dont need a better fix atm but hope to find a better solution too!
Versions: DB Version Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Platform: win32 Node.js version: v18.18.0
Architecture: x64 oracledb version: 6.2.0 Oracle client version: undefined //Dont know why its undifined
SELECT * FROM CUSTOMERS
do just run but running a procedure doesn'tThis is the procedure I'm trying to run (Running this in SQL Developer does work)!!
I tried calling this procedure with serveral methods:
and
There are some more implementations that i tried that where in between these, not going to list them all, would become a very large issue.
If we take the second example i can put
SELECT * FROM CUSTOMERS
inconst query
it works as expected so we can rule all all connection issues I think.Full js file of the first implementation: https://gist.github.com/jonesy-b-dev/2dcb6332d954e913d0c598295f0c0383
And the full js file of the second implementation: https://gist.github.com/jonesy-b-dev/45de81f0e6bc756cdea0e8bf305a0425
I have no clue how to solve it. Anyone an idea?
Greets,
Jonas