I got an issue with nodejs oracledb package. Executing SELECT queries work, but when I execute one UPDATE query literally the library gets stuck (The promise is never resolved) and none any new other oracle commands will ever get resolved (including new SELECT queries).
const out = await db.connection.execute( `SELECT COUNT(*) FROM MYTABLE WHERE MYFIELD = :1`, ['JOHN] )
The above request is resolved while the next UPDATE request gets stuck and the promise is never resolved.
try{
const out = await db.connection.execute(`UPDATE MYTABLE SET MYFIELD = :1 WHERE ID = :2`, ['JOHN', 1])
console.log("success")
}catch(err){
console.error("Error", err)
}
It gets stuck. If I will do another SELECT, the new requests will get stuck as well idefinitely.
The general cause is that the same (or similar) statement was run in a tool like SQL*Plus or SQL Developer but wasn't committed. Therefore the row is locked and can't be updated by your Node.js application.