-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
- What versions are you using?
process.platform: win32 (also tested separately in a linux environment)
process.version: v18.12.1
process.arch: x64
require('oracledb').versionString: 6.0.1
require('oracledb').oracleClientVersionString: 19.10.0.0.0
- Is it an error or a hang or a crash?
Error
- What error(s) or behavior you are seeing?
The issue only happens in thin mode. Thick mode works fine. The specific error varies, oddly enough. The most common is NJS-103: unexpected message type 48 received while some other ones are NJS-103: unexpected message type 32 received or Cannot read properties of undefined (reading 'statement')
Error: NJS-103: unexpected message type 48 received
at Object.throwErr (D:\Code\node_modules\oracledb\lib\errors.js:591:10)
at ExecuteMessage.processMessage (D:\Code\node_modules\oracledb\lib\thin\protocol\messages\base.js:218:14)
at ExecuteMessage.processMessage (D:\Code\node_modules\oracledb\lib\thin\protocol\messages\withData.js:89:13)
at ExecuteMessage.process (D:\Code\node_modules\oracledb\lib\thin\protocol\messages\base.js:197:12)
at ExecuteMessage.process (D:\Code\node_modules\oracledb\lib\thin\protocol\messages\withData.js:510:11)
at ExecuteMessage.decode (D:\Code\node_modules\oracledb\lib\thin\protocol\messages\base.js:188:10)
at Protocol._decodeMessage (D:\Code\node_modules\oracledb\lib\thin\protocol\protocol.js:77:17)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Protocol._processMessage (D:\Code\node_modules\oracledb\lib\thin\protocol\protocol.js:148:9)
at async ThinConnectionImpl.execute (D:\Code\node_modules\oracledb\lib\thin\connection.js:796:5)
at async Connection.execute (D:\Code\node_modules\oracledb\lib\connection.js:860:16)
at async Connection.<anonymous> (D:\Code\node_modules\oracledb\lib\util.js:162:14)
- Include a runnable Node.js script that shows the problem.
connection = await pool.getConnection();
const sql = `
BEGIN
${Array(150).fill(null).map((_, i) => `OPEN :v_out_${i}_0 FOR select :a_${i}, :b_${i}, :c_${i} from dual;`).join('\n ')}
END;
`;
const params = Array(150).fill(null).map((_, i) => ({ [`a_${i}`]: 1, [`b_${i}`]: 2, [`c_${i}`]: 3, [`v_out_${i}_0`]: { dir: oracledb.BIND_OUT, type: oracledb.CURSOR } }))
.reduce((a, x) => ({ ...a, ...x }), {});
await connection.execute(sql, params);If you reduce the "150" to, for instance, 5 or 10, there is no error. If you remove all the in bind variables, there is no error.
connection = await pool.getConnection();
const sql = `
BEGIN
${Array(5).fill(null).map((_, i) => `OPEN :v_out_${i}_0 FOR select :a_${i}, :b_${i}, :c_${i} from dual;`).join('\n ')}
END;
`;
const params = Array(5).fill(null).map((_, i) => ({ [`a_${i}`]: 1, [`b_${i}`]: 2, [`c_${i}`]: 3, [`v_out_${i}_0`]: { dir: oracledb.BIND_OUT, type: oracledb.CURSOR } }))
.reduce((a, x) => ({ ...a, ...x }), {});
await connection.execute(sql, params); // <---- No errorconnection = await pool.getConnection();
const sql = `
BEGIN
${Array(150).fill(null).map((_, i) => `OPEN :v_out_${i}_0 FOR select 1 from dual;`).join('\n ')}
END;
`;
const params = Array(150).fill(null).map((_, i) => ({ [`v_out_${i}_0`]: { dir: oracledb.BIND_OUT, type: oracledb.CURSOR } }))
.reduce((a, x) => ({ ...a, ...x }), {});
await connection.execute(sql, params); // <---- No error