Skip to content

Commit 9d8ebdc

Browse files
committed
Fixed bug which threw an error due to the presence of duplicate cursors with DRCP
1 parent 23ec839 commit 9d8ebdc

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

doc/src/release_notes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ Thin Mode Changes
5858
#) Added support for usage with extension of Array.prototype methods
5959
See `Issue #1653 <https://github.com/oracle/node-oracledb/issues/1653>`__.
6060

61+
#) Fixed bug which threw an error due to the presence of duplicate cursors
62+
with DRCP.
63+
6164
Thick Mode Changes
6265
+++++++++++++++++++
6366

lib/thin/protocol/messages/base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ class Message {
282282
const flags = buf.readUB4(); // session flags
283283
if (flags & constants.TNS_SESSGET_SESSION_CHANGED) {
284284
if (this.connection._drcpEstablishSession) {
285-
this.connection.statementCache.clearOpenCursors();
285+
this.connection.statementCache.clearCursors();
286286
}
287287
}
288288
this.connection._drcpEstablishSession = false;

lib/thin/protocol/protocol.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class Protocol {
167167
this.txnInProgress = Boolean(message.callStatus & constants.TNS_EOCS_FLAGS_TXN_IN_PROGRESS);
168168
// processes the call status flags returned by the server.
169169
if (message.callStatus & constants.TNS_EOCS_FLAGS_SESS_RELEASE) {
170-
message.connection.statementCache.clearOpenCursors();
170+
message.connection.statementCache.clearCursors();
171171
}
172172

173173
if (message.errorOccurred) {

lib/thin/statementCache.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ class StatementCache {
7171
}
7272

7373
//---------------------------------------------------------------------------
74-
//clearOpenCursors() {
74+
//clearCursors() {
7575
// Clears the list of open cursors and removes the list of cursors that
7676
// need to be closed. This is required when a DRCP session change has
7777
// taken place as the cursor ID values are invalidated.
7878
//---------------------------------------------------------------------------
79-
clearOpenCursors() {
79+
clearCursors() {
8080
const newOpenCursors = new Set();
8181
for (const stmt of this._openCursors) {
8282
if (stmt.inUse || stmt.returnToCache) {
@@ -86,6 +86,7 @@ class StatementCache {
8686
stmt._clearState();
8787
}
8888
this._openCursors = newOpenCursors;
89+
this._cursorsToClose.clear();
8990
}
9091

9192
//---------------------------------------------------------------------------

test/dataTypeVector4.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ describe('298. dataTypeVector4.js', function() {
335335
`, binds);
336336
}
337337

338-
await connection.execute(`delete /*+ parallel(4) */ from ${tableName}
338+
await connection.execute(`delete /*+ parallel(4) */ from ${tableName}
339339
where vector_distance(VectorCol, ${sampleVector}, euclidean) < 10`);
340340

341341
const result = await connection.execute(`
@@ -373,7 +373,7 @@ describe('298. dataTypeVector4.js', function() {
373373
`, binds);
374374
}
375375

376-
await connection.execute(`delete /*+ no_parallel(4) */ from ${tableName}
376+
await connection.execute(`delete /*+ no_parallel(4) */ from ${tableName}
377377
where vector_distance(VectorCol, ${sampleVector}, euclidean) < 10`);
378378

379379
const result = await connection.execute(`

0 commit comments

Comments
 (0)