Skip to content

Commit 56d9ced

Browse files
committed
Changed default values of transportConnectTimeout and retryDelay properties in oracledb.getConnection() and oracledb.createPool() methods for consistency with other Oracle Database drivers
1 parent 2ed22bb commit 56d9ced

File tree

5 files changed

+31
-5
lines changed

5 files changed

+31
-5
lines changed

doc/src/api_manual/oracledb.rst

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2143,10 +2143,14 @@ Oracledb Methods
21432143

21442144
The number of seconds to wait before making a new connection attempt.
21452145

2146-
The default value is *0*.
2146+
The default value is *1*.
21472147

21482148
For node-oracledb Thick mode, use an :ref:`Easy Connect string <easyconnect>` or a :ref:`Connect Descriptor string <embedtns>` instead.
21492149

2150+
.. versionchanged:: 6.7
2151+
2152+
The default value was changed from 0 seconds to 1 second.
2153+
21502154
.. versionadded:: 6.0
21512155
* - ``connectTimeout``
21522156
- Number
@@ -2167,10 +2171,14 @@ Oracledb Methods
21672171

21682172
The maximum number of seconds to wait to establish a connection to the database host.
21692173

2170-
The default value is *60.0*.
2174+
The default value is *20.0*.
21712175

21722176
For node-oracledb Thick mode, use an :ref:`Easy Connect string <easyconnect>` or a :ref:`Connect Descriptor string <embedtns>` instead.
21732177

2178+
.. versionchanged:: 6.7
2179+
2180+
The default value was changed from 60.0 seconds to 20.0 seconds.
2181+
21742182
.. versionadded:: 6.0
21752183
* - ``expireTime``
21762184
- Number
@@ -2841,10 +2849,14 @@ Oracledb Methods
28412849

28422850
The number of seconds to wait before making a new connection attempt.
28432851

2844-
The default value is *0*.
2852+
The default value is *1*.
28452853

28462854
For node-oracledb Thick mode, use an :ref:`Easy Connect string <easyconnect>` or a :ref:`Connect Descriptor string <embedtns>` instead.
28472855

2856+
.. versionchanged:: 6.7
2857+
2858+
The default value was changed from 0 seconds to 1 second.
2859+
28482860
.. versionadded:: 6.0
28492861
* - ``connectTimeout``
28502862
- Number
@@ -2865,10 +2877,14 @@ Oracledb Methods
28652877

28662878
The maximum number of seconds to wait to establish a connection to the database host.
28672879

2868-
The default value is *60.0*.
2880+
The default value is *20.0*.
28692881

28702882
For node-oracledb Thick mode, use an :ref:`Easy Connect string <easyconnect>` or a :ref:`Connect Descriptor string <embedtns>` instead.
28712883

2884+
.. versionchanged:: 6.7
2885+
2886+
The default value was changed from 60.0 seconds to 20.0 seconds.
2887+
28722888
.. versionadded:: 6.0
28732889
* - ``expireTime``
28742890
- Number

doc/src/release_notes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ Common Changes
1616
Thin Mode Changes
1717
+++++++++++++++++
1818

19+
#) Changed default values of ``transportConnectTimeout`` and
20+
``retryDelay`` properties in :meth:`oracledb.getConnection()` and
21+
:meth:`oracledb.createPool()` for consistency with other Oracle Database
22+
drivers.
23+
1924
#) Changed the password type parameter values from `vault-oci` and
2025
`vault-azure` to `ocivault` and `azurevault` respectively for consistency
2126
with other Oracle Database drivers.

lib/thin/sqlnet/connStrategy.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
const { NavAddress, NavAddressList, NavDescription, NavDescriptionList } = require("./navNodes.js");
3030
const { createNVPair } = require("./nvStrToNvPair.js");
3131
const errors = require("../../errors.js");
32+
const constants = require("./constants.js");
3233

3334
/**
3435
* Class that holds all possible attributes under Description
@@ -114,6 +115,8 @@ class ConnStrategy {
114115
if (config != null) {
115116
if ((delay == 0 || delay == undefined) && config.retryDelay > 0) {
116117
delay = config.retryDelay * 1000;
118+
} else if (!delay) {
119+
delay = constants.DEFAULT_RETRY_DELAY; // 1 sec default
117120
}
118121
}
119122
for (let i = this.lastRetryCounter; i <= this.retryCount; ++i) {

lib/thin/sqlnet/constants.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ module.exports = {
187187
DISABLE_OOB_STR: 'DISABLE_OOB', // disable OOB parameter
188188
EXPIRE_TIME: 'EXPIRE_TIME', // expire Time
189189
PEM_WALLET_FILE_NAME: 'ewallet.pem',
190+
DEFAULT_TRANSPORT_CONNECT_TIMEOUT: 20000, //default transport connect timeout
191+
DEFAULT_RETRY_DELAY: 1000, //default retry delay
190192

191193
/* Get/Set options */
192194
NT_MOREDATA: 1, // More Data in Transport available

lib/thin/sqlnet/sessionAtts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class SessionAtts {
168168
}
169169

170170
if (!this.connectTimeout && !this.transportConnectTimeout)
171-
this.transportConnectTimeout = 60 * 1000; /* Default to 60 secs */
171+
this.transportConnectTimeout = constants.DEFAULT_TRANSPORT_CONNECT_TIMEOUT; /* Default to 20 secs */
172172
}
173173

174174
}

0 commit comments

Comments
 (0)