Skip to content

Commit

Permalink
Use the value set in oracledb.connectionClass as soon as the pool is …
Browse files Browse the repository at this point in the history
…created with DRCP
  • Loading branch information
sharadraju committed Jul 6, 2023
1 parent fb508f9 commit bd5e515
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions doc/src/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ node-oracledb Release Notes
node-oracledb `v6.0.3 <https://github.com/oracle/node-oracledb/compare/v6.0.2...v6.0.3>`__ (TBD)
------------------------------------------------------------------------------------------------

Common Changes
++++++++++++++

#) Fixed bug to consistently use the DRCP :attr:`oracledb.connectionClass` in effect when the
pool was created.

Thin Mode Changes
+++++++++++++++++

Expand Down
5 changes: 4 additions & 1 deletion lib/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class Pool extends EventEmitter {
this._timeOfReset = this._createdDate = Date.now();
this._sessionCallback = undefined;
this._connRequestQueue = [];
this._connectionClass = settings.connectionClass;
}

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -376,7 +377,9 @@ class Pool extends EventEmitter {
errors.assertParamValue(nodbUtil.isObject(a1), 1);
options = this._verifyGetConnectionOptions(a1);
}
settings.addToOptions(options, "connectionClass");

// get connection class value from pool
options.connectionClass = this._connectionClass;

// if pool is draining/closed, throw an appropriate error
this._checkPoolOpen(true);
Expand Down
3 changes: 0 additions & 3 deletions lib/thin/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,6 @@ class ThinPoolImpl extends PoolImpl {
// create new connection and return it
//---------------------------------------------------------------------------
async getConnection() {
if (settings.connectionClass !== '') {
this._userConfig.connectionClass = settings.connectionClass;
}
return await this.acquire();
}

Expand Down

0 comments on commit bd5e515

Please sign in to comment.