Closed sosoba closed 1 year ago
The destroy()
method is the standard stream method and not one specific to node-oracledb. It is true that node-oracledb requires the use of the connection to destroy the LOB and therefore may require a round trip and is asynchronous in nature. You can resolve the matter by using this code:
await new Promise((resolve) => {
lob.on('close', resolve);
lob.destroy();
});
I'm not sure if there is a better approach but this one certainly works!
This issue has been automatically marked as inactive because it has not been updated recently. It will be closed if no further activity occurs. Thank you for your contributions.
NJS-081: concurrent operations on a connection are disabled
const failOutputStream = new Writable({ write: callbackify(async () => { await setTimeout(1); throw new Error('No left space on device'); }) });
oracledb.errorOnConcurrentExecute = true;
const conn = await oracledb.getConnection({ user: '', password: '', connectString: '', });
const {rows: [[lob]]} = await conn.execute("select lob_column from lob_table"); try { await pipeline(lob, failOutputStream); } catch (e) { console.log('Cannot copy blob to file. Reason:', e.message); }
console.log('closed:', lob.closed, 'destroyed:', lob.destroyed, 'errored:', !!lob.errored, 'inProgress:', conn._inProgress); // closed: false destroyed: true errored: true inProgress: true
await conn.execute('SELECT * FROM DUAL'); // Throws NJS-081: concurrent operations on a connection are disabled