oracledb 6.8.0 → 6.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +39 -3
  2. package/build/Release/oracledb-6.9.0-darwin-arm64.node +0 -0
  3. package/build/Release/oracledb-6.9.0-darwin-arm64.node-buildinfo.txt +1 -0
  4. package/build/Release/oracledb-6.9.0-darwin-x64.node +0 -0
  5. package/build/Release/oracledb-6.9.0-darwin-x64.node-buildinfo.txt +1 -0
  6. package/build/Release/oracledb-6.9.0-js-buildinfo.txt +1 -0
  7. package/build/Release/oracledb-6.9.0-linux-arm64.node +0 -0
  8. package/build/Release/oracledb-6.9.0-linux-arm64.node-buildinfo.txt +1 -0
  9. package/build/Release/oracledb-6.9.0-linux-x64.node +0 -0
  10. package/build/Release/oracledb-6.9.0-linux-x64.node-buildinfo.txt +1 -0
  11. package/build/Release/oracledb-6.9.0-win32-x64.node +0 -0
  12. package/build/Release/oracledb-6.9.0-win32-x64.node-buildinfo.txt +1 -0
  13. package/lib/aqMessage.js +10 -1
  14. package/lib/configProviders/file.js +72 -0
  15. package/lib/connection.js +87 -2
  16. package/lib/dbObject.js +9 -0
  17. package/lib/errors.js +56 -31
  18. package/lib/impl/connection.js +9 -0
  19. package/lib/impl/pool.js +10 -1
  20. package/lib/impl/resultset.js +5 -4
  21. package/lib/lob.js +9 -1
  22. package/lib/oracledb.js +129 -16
  23. package/lib/pool.js +12 -1
  24. package/lib/poolStatistics.js +3 -1
  25. package/lib/thin/connection.js +117 -10
  26. package/lib/thin/dbObject.js +8 -6
  27. package/lib/thin/lob.js +2 -3
  28. package/lib/thin/pool.js +105 -28
  29. package/lib/thin/protocol/capabilities.js +7 -3
  30. package/lib/thin/protocol/constants.js +29 -1
  31. package/lib/thin/protocol/messages/auth.js +13 -0
  32. package/lib/thin/protocol/messages/base.js +98 -9
  33. package/lib/thin/protocol/messages/dataType.js +2 -1
  34. package/lib/thin/protocol/messages/execute.js +46 -4
  35. package/lib/thin/protocol/messages/lobOp.js +5 -22
  36. package/lib/thin/protocol/messages/logOff.js +0 -1
  37. package/lib/thin/protocol/messages/sessionRelease.js +0 -1
  38. package/lib/thin/protocol/messages/transactionSwitch.js +12 -4
  39. package/lib/thin/protocol/protocol.js +2 -1
  40. package/lib/thin/sqlnet/connStrategy.js +2 -1
  41. package/lib/thin/sqlnet/navNodes.js +1 -1
  42. package/lib/thin/sqlnet/networkSession.js +9 -3
  43. package/lib/thin/sqlnet/packet.js +2 -1
  44. package/lib/thin/sqlnet/sessionAtts.js +2 -3
  45. package/lib/types.js +0 -5
  46. package/lib/util.js +76 -2
  47. package/lib/version.js +1 -1
  48. package/package/install.js +3 -3
  49. package/package/prunebinaries.js +6 -12
  50. package/package.json +2 -2
  51. package/{lib/configProviders/azure.js → plugins/configProviders/azure/index.js} +70 -63
  52. package/plugins/configProviders/azurevault/index.js +84 -0
  53. package/{lib → plugins}/configProviders/base.js +13 -3
  54. package/{lib/configProviders/ociobject.js → plugins/configProviders/ociobject/index.js} +43 -78
  55. package/plugins/configProviders/ocivault/index.js +100 -0
  56. package/plugins/token/extensionOci/index.js +71 -35
  57. package/build/Release/oracledb-6.8.0-darwin-arm64.node +0 -0
  58. package/build/Release/oracledb-6.8.0-darwin-arm64.node-buildinfo.txt +0 -1
  59. package/build/Release/oracledb-6.8.0-darwin-x64.node +0 -0
  60. package/build/Release/oracledb-6.8.0-darwin-x64.node-buildinfo.txt +0 -1
  61. package/build/Release/oracledb-6.8.0-js-buildinfo.txt +0 -1
  62. package/build/Release/oracledb-6.8.0-linux-arm64.node +0 -0
  63. package/build/Release/oracledb-6.8.0-linux-arm64.node-buildinfo.txt +0 -1
  64. package/build/Release/oracledb-6.8.0-linux-x64.node +0 -0
  65. package/build/Release/oracledb-6.8.0-linux-x64.node-buildinfo.txt +0 -1
  66. package/build/Release/oracledb-6.8.0-win32-x64.node +0 -0
  67. package/build/Release/oracledb-6.8.0-win32-x64.node-buildinfo.txt +0 -1
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # node-oracledb version 6.8.0
1
+ # node-oracledb version 6.9.0 <img src="https://img.shields.io/npm/v/oracledb.svg" alt="oracledb"/> <img src="https://img.shields.io/npm/dm/oracledb.svg" alt="oracledb"/>
2
2
 
3
3
  The node-oracledb add-on for Node.js powers high performance Oracle Database
4
4
  applications. Applications can be written in TypeScript, or directly in
5
5
  JavaScript.
6
6
 
7
- Use node-oracledb 6.8.0 to connect Node.js 14.6, or later, to Oracle
7
+ Use node-oracledb 6.9.0 to connect Node.js 14.17, or later, to Oracle
8
8
  Database. Older versions of node-oracledb may work with older versions of
9
9
  Node.js.
10
10
 
@@ -16,8 +16,42 @@ It is stable, well documented, and has a comprehensive test suite.
16
16
 
17
17
  ## Installation
18
18
 
19
+ Run `npm install oracledb`
20
+
19
21
  See [Getting Started with Node-oracledb][1] and [Quick Start Node-oracledb Installation][2].
20
22
 
23
+ ## Dependencies and Interoperability
24
+
25
+ - Node.js versions 14.17 and later.
26
+
27
+ Pre-built packages are available on [npm][14] and other mirror repositories.
28
+
29
+ Source code is also available.
30
+
31
+ Previous versions of node-oracledb supported older Node.js versions.
32
+
33
+ - Oracle Client libraries are *optional* starting from node-oracledb 6.0.
34
+ Older versions of node-oracledb require Oracle Client libraries.
35
+
36
+ **Thin mode**: By default node-oracledb (from version 6.0 onwards) runs in a
37
+ 'Thin' mode which connects directly to Oracle Database.
38
+
39
+ **Thick mode**: Some advanced Oracle Database functionality is currently only
40
+ available when optional Oracle Client libraries are loaded by
41
+ node-oracledb. Libraries are available in the free [Oracle Instant
42
+ Client][15] packages. Node-oracledb can use Oracle Client
43
+ libraries 11.2 through 23ai.
44
+
45
+ - Oracle Database
46
+
47
+ **Thin mode**: Oracle Database 12.1 (or later) is required.
48
+
49
+ **Thick mode**: Oracle Database 9.2 (or later) is required, depending on the
50
+ Oracle Client library version. Oracle Database's standard client-server
51
+ version interoperability allows connection to both older and newer
52
+ databases. For example when node-oracledb uses Oracle Client 19c libraries,
53
+ then it can connect to Oracle Database 11.2 or later.
54
+
21
55
  ## Documentation
22
56
 
23
57
  See [Documentation for the Oracle Database Node.js Add-on][9] and the [release
@@ -34,7 +68,7 @@ to join Slack][6]).
34
68
 
35
69
  ## <a name="testing"></a> Tests
36
70
 
37
- To run the test suite see [test/README][11].
71
+ To run the test suite, see [test/README][11].
38
72
 
39
73
  ## Contributing
40
74
 
@@ -83,3 +117,5 @@ limitations under the License.
83
117
  [11]: https://github.com/oracle/node-oracledb/blob/main/test/README.md
84
118
  [12]: https://github.com/oracle/node-oracledb/blob/main/CONTRIBUTING.md
85
119
  [13]: https://github.com/oracle/node-oracledb/blob/main/SECURITY.md
120
+ [14]: https://www.npmjs.com/package/oracledb
121
+ [15]: https://www.oracle.com/database/technologies/instant-client.html
@@ -0,0 +1 @@
1
+ oracledb-6.9.0-darwin-arm64.node v23.10.0 2eb94e8660458ba0f6a59a00ebaa1d65e380cbd9 9cbfa993c59da0cfba2baa65e1c51fc0216bf586 Tue, 15 Jul 2025 11:23:44 GMT
@@ -0,0 +1 @@
1
+ oracledb-6.9.0-darwin-x64.node v22.16.0 2eb94e8660458ba0f6a59a00ebaa1d65e380cbd9 9cbfa993c59da0cfba2baa65e1c51fc0216bf586 Tue, 15 Jul 2025 11:07:19 GMT
@@ -0,0 +1 @@
1
+ 2eb94e8660458ba0f6a59a00ebaa1d65e380cbd9
@@ -0,0 +1 @@
1
+ oracledb-6.9.0-linux-arm64.node v20.19.2 2eb94e8660458ba0f6a59a00ebaa1d65e380cbd9 9cbfa993c59da0cfba2baa65e1c51fc0216bf586 Tue, 15 Jul 2025 11:06:47 GMT
@@ -0,0 +1 @@
1
+ oracledb-6.9.0-linux-x64.node v22.13.1 2eb94e8660458ba0f6a59a00ebaa1d65e380cbd9 9cbfa993c59da0cfba2baa65e1c51fc0216bf586 Tue, 15 Jul 2025 11:48:53 GMT
@@ -0,0 +1 @@
1
+ oracledb-6.9.0-win32-x64.node v20.17.0 2eb94e8660458ba0f6a59a00ebaa1d65e380cbd9 9cbfa993c59da0cfba2baa65e1c51fc0216bf586 Tue, 15 Jul 2025 11:04:06 GMT
package/lib/aqMessage.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2019, 2022, Oracle and/or its affiliates.
1
+ // Copyright (c) 2019, 2025, Oracle and/or its affiliates.
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
@@ -48,6 +48,15 @@ class AqMessage {
48
48
  return this._impl.getDelay();
49
49
  }
50
50
 
51
+ //---------------------------------------------------------------------------
52
+ // enqTime
53
+ //
54
+ // Property to indicate the enqueue time for the message.
55
+ //---------------------------------------------------------------------------
56
+ get enqTime() {
57
+ return this._impl.getEnqTime();
58
+ }
59
+
51
60
  //---------------------------------------------------------------------------
52
61
  // deliveryMode
53
62
  //
@@ -0,0 +1,72 @@
1
+ // Copyright (c) 2025, Oracle and/or its affiliates.
2
+
3
+ //-----------------------------------------------------------------------------
4
+ //
5
+ // This software is dual-licensed to you under the Universal Permissive License
6
+ // (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
7
+ // 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
8
+ // either license.
9
+ //
10
+ // If you elect to accept the software under the Apache License, Version 2.0,
11
+ // the following applies:
12
+ //
13
+ // Licensed under the Apache License, Version 2.0 (the "License");
14
+ // you may not use this file except in compliance with the License.
15
+ // You may obtain a copy of the License at
16
+ //
17
+ // https://www.apache.org/licenses/LICENSE-2.0
18
+ //
19
+ // Unless required by applicable law or agreed to in writing, software
20
+ // distributed under the License is distributed on an "AS IS" BASIS,
21
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ // See the License for the specific language governing permissions and
23
+ // limitations under the License.
24
+ //
25
+ //-----------------------------------------------------------------------------
26
+ const fs = require('fs').promises;
27
+ const util = require('node:util');
28
+ const oracledb = require('oracledb');
29
+ class locaJson {
30
+
31
+ constructor(provider_arg, urlExtendedPart) {
32
+ const params = new URLSearchParams(urlExtendedPart);
33
+ this.paramMap = new URLSearchParams([...params].map(([key, value]) => [key.toLowerCase(), value])); //parse the extended part and store parameters in Map
34
+ this.paramMap.set('filepath', provider_arg);
35
+ }
36
+ //---------------------------------------------------------------------------
37
+ // init()
38
+ //
39
+ // Require/import modules from ociobject
40
+ //---------------------------------------------------------------------------
41
+ init() {
42
+ // nothing to require
43
+ }
44
+ async returnConfig() {
45
+ const alias = this.paramMap.get('alias');
46
+ // Read input file
47
+ const data = Buffer.from(await fs.readFile(this.paramMap.get("filepath"), { encoding: 'utf8', flag: 'r' }));
48
+ // Converting to JSON
49
+ const listofAliases = JSON.parse(data);
50
+ if (alias) {
51
+ this.obj = listofAliases[alias];
52
+ } else {
53
+ this.obj = listofAliases;
54
+ }
55
+ return this.obj;
56
+ }
57
+ }
58
+ //---------------------------------------------------------------------------
59
+ // hookFn()
60
+ // hookFn will get registered to the driver while loading the plugins
61
+ //---------------------------------------------------------------------------
62
+ async function hookFn(args) {
63
+ const configProvider = new locaJson(args.provider_arg, args.urlExtendedPart);
64
+ try {
65
+ configProvider.init();
66
+ } catch (err) {
67
+ const errmsg = util.format('Centralized Config Provider failed to load required libraries. Please install the required libraries.\n %s', err.message);
68
+ throw new Error(errmsg);
69
+ }
70
+ return [await configProvider.returnConfig(), configProvider.credential];
71
+ }
72
+ oracledb.registerConfigurationProviderHook('file', hookFn);
package/lib/connection.js CHANGED
@@ -110,6 +110,8 @@ class Connection extends EventEmitter {
110
110
  options.connection = this;
111
111
  if (options.keepInStmtCache === undefined)
112
112
  options.keepInStmtCache = true;
113
+ if (options.suspendOnSuccess === undefined)
114
+ options.suspendOnSuccess = false;
113
115
  settings.addToOptions(options,
114
116
  "autoCommit",
115
117
  "dbObjectAsPojo",
@@ -138,7 +140,12 @@ class Connection extends EventEmitter {
138
140
  }
139
141
  return (proxy);
140
142
  } else if (initialValue !== undefined) {
141
- Object.assign(this, initialValue);
143
+ for (const attr of objType.attributes) {
144
+ const value = initialValue[attr.name];
145
+ if (value !== undefined) {
146
+ this._setAttrValue(attr, value);
147
+ }
148
+ }
142
149
  }
143
150
  };
144
151
  DbObject.prototype = Object.create(BaseDbObject.prototype);
@@ -591,6 +598,11 @@ class Connection extends EventEmitter {
591
598
  outOptions.keepInStmtCache = options.keepInStmtCache;
592
599
  }
593
600
 
601
+ if (options.suspendOnSuccess !== undefined) {
602
+ errors.assertParamPropBool(options, 2, "suspendOnSucess");
603
+ outOptions.suspendOnSuccess = options.suspendOnSuccess;
604
+ }
605
+
594
606
  // handle options specific to executeMany()
595
607
  if (inExecuteMany) {
596
608
 
@@ -701,6 +713,29 @@ class Connection extends EventEmitter {
701
713
  this._impl.setAction(value);
702
714
  }
703
715
 
716
+ //---------------------------------------------------------------------------
717
+ // beginSessionlessTransaction()
718
+ //
719
+ // Begin a new sessionless transaction with provided transactionId.
720
+ // If transactionId wasn't provided a random-generated transactionId will be
721
+ // used and returned.
722
+ //---------------------------------------------------------------------------
723
+ async beginSessionlessTransaction(options = {}) {
724
+ errors.assertArgCount(arguments, 0, 1);
725
+ errors.assertParamValue(nodbUtil.isObject(options), 1);
726
+ if (options.transactionId !== undefined)
727
+ errors.assertParamPropValue(
728
+ nodbUtil.isTransactionId(options.transactionId), 1, 'transactionId');
729
+ errors.assertParamPropUnsignedIntNonZero(options, 1, 'timeout');
730
+ errors.assertParamPropBool(options, 1, 'deferRoundTrip');
731
+ const normalizedTransactionId =
732
+ nodbUtil.normalizeTransactionId(options.transactionId);
733
+ const {timeout = 60, deferRoundTrip = false} = options;
734
+ await this._impl.startSessionlessTransaction(normalizedTransactionId,
735
+ timeout, constants.TPC_BEGIN_NEW, deferRoundTrip);
736
+ return normalizedTransactionId;
737
+ }
738
+
704
739
  //---------------------------------------------------------------------------
705
740
  // breakExecution()
706
741
  //
@@ -1255,6 +1290,18 @@ class Connection extends EventEmitter {
1255
1290
  this._impl.setInternalName(value);
1256
1291
  }
1257
1292
 
1293
+ //---------------------------------------------------------------------------
1294
+ // ltxid
1295
+ //
1296
+ // Property for identifying the logical transaction ID to avoid duplicate
1297
+ // transactions. Used with Oracle Transaction Guard.
1298
+ //---------------------------------------------------------------------------
1299
+ get ltxid() {
1300
+ if (this._impl)
1301
+ return this._impl.getLTXID();
1302
+ return undefined;
1303
+ }
1304
+
1258
1305
  //--------------------------------------------------------------------------
1259
1306
  // isHealthy()
1260
1307
  //
@@ -1407,6 +1454,25 @@ class Connection extends EventEmitter {
1407
1454
  return (stream);
1408
1455
  }
1409
1456
 
1457
+ //---------------------------------------------------------------------------
1458
+ // resumeSessionlessTransaction()
1459
+ //
1460
+ // Resume an existing sessionlesss transaction using given transactionId
1461
+ //---------------------------------------------------------------------------
1462
+ async resumeSessionlessTransaction(transactionId, options = {}) {
1463
+ errors.assertArgCount(arguments, 1, 2);
1464
+ errors.assertParamValue(nodbUtil.isTransactionId(transactionId), 1);
1465
+ errors.assertParamValue(nodbUtil.isObject(options), 2);
1466
+ errors.assertParamPropUnsignedInt(options, 2, 'timeout');
1467
+ errors.assertParamPropBool(options, 2, 'deferRoundTrip');
1468
+ const normalizedTransactionId =
1469
+ nodbUtil.normalizeTransactionId(transactionId);
1470
+ const {timeout = 60, deferRoundTrip = false} = options;
1471
+ await this._impl.startSessionlessTransaction(normalizedTransactionId,
1472
+ timeout, constants.TPC_BEGIN_RESUME, deferRoundTrip);
1473
+ return normalizedTransactionId;
1474
+ }
1475
+
1410
1476
  //---------------------------------------------------------------------------
1411
1477
  // rollback()
1412
1478
  //
@@ -1521,6 +1587,17 @@ class Connection extends EventEmitter {
1521
1587
  return outValue;
1522
1588
  }
1523
1589
 
1590
+ //---------------------------------------------------------------------------
1591
+ // suspendSessionlessTransaction()
1592
+ //
1593
+ // Suspend any active sessionless transaction immediately
1594
+ //---------------------------------------------------------------------------
1595
+ async suspendSessionlessTransaction() {
1596
+ errors.assertArgCount(arguments, 0, 0);
1597
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1598
+ await this._impl.suspendSessionlessTransaction();
1599
+ }
1600
+
1524
1601
  //---------------------------------------------------------------------------
1525
1602
  // tag
1526
1603
  //
@@ -1711,7 +1788,12 @@ class Connection extends EventEmitter {
1711
1788
  errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1712
1789
  errors.assert(_subscriptions.has(name), errors.ERR_INVALID_SUBSCR);
1713
1790
  await this._impl.unsubscribe(_subscriptions.get(name));
1714
- _subscriptions.delete(name);
1791
+
1792
+ // Delay decreasing the reference count
1793
+ // as NJS layer starts cleanup (uv_close) of async handle asynchronously.
1794
+ setTimeout(() => {
1795
+ _subscriptions.delete(name);
1796
+ }, 0);
1715
1797
  }
1716
1798
 
1717
1799
  }
@@ -1724,6 +1806,7 @@ Connection.prototype.break =
1724
1806
  Connection.prototype.tpcRecover =
1725
1807
  nodbUtil.callbackify(nodbUtil.wrapFn(Connection.prototype.tpcRecover));
1726
1808
  nodbUtil.wrapFns(Connection.prototype,
1809
+ "beginSessionlessTransaction",
1727
1810
  "changePassword",
1728
1811
  "close",
1729
1812
  "commit",
@@ -1734,10 +1817,12 @@ nodbUtil.wrapFns(Connection.prototype,
1734
1817
  "getQueue",
1735
1818
  "getStatementInfo",
1736
1819
  "ping",
1820
+ "resumeSessionlessTransaction",
1737
1821
  "rollback",
1738
1822
  "shutdown",
1739
1823
  "startup",
1740
1824
  "subscribe",
1825
+ "suspendSessionlessTransaction",
1741
1826
  "tpcBegin",
1742
1827
  "tpcCommit",
1743
1828
  "tpcEnd",
package/lib/dbObject.js CHANGED
@@ -200,6 +200,15 @@ class BaseDbObject {
200
200
  if (implAttr.typeClass) {
201
201
  attr.typeClass = implAttr.typeClass;
202
202
  }
203
+ if (implAttr.precision != null) {
204
+ attr.precision = implAttr.precision;
205
+ }
206
+ if (implAttr.scale != null) {
207
+ attr.scale = implAttr.scale;
208
+ }
209
+ if (implAttr.maxSize != null) {
210
+ attr.maxSize = implAttr.maxSize;
211
+ }
203
212
  attrs[implAttr.name] = attr;
204
213
  }
205
214
  this._attributes = attrs;
package/lib/errors.js CHANGED
@@ -175,6 +175,9 @@ const ERR_DB_FETCH_TYPE_HANDLER_CONVERTER = 166;
175
175
  const ERR_DB_FETCH_TYPE_HANDLER_RETURN_VALUE = 167;
176
176
  const ERR_ACCESS_TOKEN = 168;
177
177
  const ERR_CALLOUT_FN = 169;
178
+ const ERR_SESSIONLESS_DIFFERING_METHODS = 170;
179
+ const ERR_SESSIONLESS_ALREADY_ACTIVE = 171;
180
+ const ERR_SESSIONLESS_INACTIVE = 172;
178
181
 
179
182
  // Oracle Net layer errors start from 500
180
183
  const ERR_CONNECTION_CLOSED = 500;
@@ -198,19 +201,15 @@ const ERR_INVALID_SERVICE_NAME = 518;
198
201
  const ERR_INVALID_SID = 519;
199
202
  const ERR_TNS_NAMES_FILE_MISSING = 520;
200
203
  const ERR_CONNECTION_EOF = 521;
201
- const ERR_AZURE_CONFIG_PROVIDER_AUTH_FAILED = 522;
202
204
  const ERR_CONFIG_PROVIDER_FAILED_TO_RETRIEVE_CONFIG = 523;
203
- const ERR_CONFIG_PROVIDER_NOT_SUPPORTED = 524;
204
- const ERR_CONFIG_PROVIDER_LOAD_FAILED = 525;
205
- const ERR_OCIOBJECT_CONFIG_PROVIDER_AUTH_FAILED = 526;
206
- const ERR_AZURE_VAULT_AUTH_FAILED = 527;
207
- const ERR_AZURE_SERVICE_PRINCIPAL_AUTH_FAILED = 528;
205
+ const ERR_REGISTER_HOOKFN_CONFIGPROVIDER = 524;
208
206
  const ERR_WALLET_TYPE_NOT_SUPPORTED = 529;
209
207
  const ERR_HOST_NOT_FOUND = 530;
210
208
  const ERR_ANO_PACKET = 531;
211
209
  const ERR_ANO_STATUS = 532;
212
210
  const ERR_ANO_NEGOTIATION = 533;
213
211
  const ERR_DATA_COMPRESSION = 534;
212
+ const ERR_CONFIG_PROVIDER_PARAM_TYPE = 535;
214
213
 
215
214
  // Oracle SUCCESS_WITH_INFO warning start from 700
216
215
  const WRN_COMPILATION_CREATE = 700;
@@ -228,11 +227,39 @@ adjustErrorXref.set("DPI-1080", ERR_CONNECTION_CLOSED);
228
227
  adjustErrorXref.set("OCI-22303", [ERR_INVALID_OBJECT_TYPE_NAME, 'type "([^"]*"."[^"]*)"']);
229
228
  adjustErrorXref.set("OCI-22164", ERR_DELETE_ELEMENTS_OF_VARRAY);
230
229
  adjustErrorXref.set("OCI-22165", [ERR_INVALID_COLL_INDEX_SET, /index \[([0-9]+)\] must be in the range of \[([0-9]+)\] to \[([0-9]+)\]/]);
230
+ adjustErrorXref.set("ORA-00022", ERR_CONNECTION_CLOSED);
231
231
  adjustErrorXref.set("ORA-00028", ERR_CONNECTION_CLOSED);
232
+ adjustErrorXref.set("ORA-00031", ERR_CONNECTION_CLOSED);
233
+ adjustErrorXref.set("ORA-00045", ERR_CONNECTION_CLOSED);
234
+ adjustErrorXref.set("ORA-00378", ERR_CONNECTION_CLOSED);
232
235
  adjustErrorXref.set("ORA-00600", ERR_CONNECTION_CLOSED);
236
+ adjustErrorXref.set("ORA-00602", ERR_CONNECTION_CLOSED);
237
+ adjustErrorXref.set("ORA-00603", ERR_CONNECTION_CLOSED);
238
+ adjustErrorXref.set("ORA-00609", ERR_CONNECTION_CLOSED);
239
+ adjustErrorXref.set("ORA-01012", ERR_CONNECTION_CLOSED);
240
+ adjustErrorXref.set("ORA-01041", ERR_CONNECTION_CLOSED);
241
+ adjustErrorXref.set("ORA-01043", ERR_CONNECTION_CLOSED);
242
+ adjustErrorXref.set("ORA-01089", ERR_CONNECTION_CLOSED);
243
+ adjustErrorXref.set("ORA-01092", ERR_CONNECTION_CLOSED);
244
+ adjustErrorXref.set("ORA-02396", ERR_CONNECTION_CLOSED);
245
+ adjustErrorXref.set("ORA-03113", ERR_CONNECTION_CLOSED);
246
+ adjustErrorXref.set("ORA-03114", ERR_CONNECTION_CLOSED);
247
+ adjustErrorXref.set("ORA-03122", ERR_CONNECTION_CLOSED);
248
+ adjustErrorXref.set("ORA-03135", ERR_CONNECTION_CLOSED);
249
+ adjustErrorXref.set("ORA-12153", ERR_CONNECTION_CLOSED);
250
+ adjustErrorXref.set("ORA-12537", ERR_CONNECTION_CLOSED);
251
+ adjustErrorXref.set("ORA-12547", ERR_CONNECTION_CLOSED);
252
+ adjustErrorXref.set("ORA-12570", ERR_CONNECTION_CLOSED);
253
+ adjustErrorXref.set("ORA-12583", ERR_CONNECTION_CLOSED);
254
+ adjustErrorXref.set("ORA-27146", ERR_CONNECTION_CLOSED);
255
+ adjustErrorXref.set("ORA-28511", ERR_CONNECTION_CLOSED);
256
+ adjustErrorXref.set("ORA-56600", ERR_CONNECTION_CLOSED);
233
257
  adjustErrorXref.set("ORA-24338", ERR_INVALID_REF_CURSOR);
234
258
  adjustErrorXref.set("ORA-25708", ERR_TOKEN_HAS_EXPIRED);
235
259
  adjustErrorXref.set("ORA-24344", WRN_COMPILATION_CREATE);
260
+ adjustErrorXref.set("ORA-26202", ERR_SESSIONLESS_INACTIVE);
261
+ adjustErrorXref.set("ORA-26211", ERR_SESSIONLESS_DIFFERING_METHODS);
262
+ adjustErrorXref.set("ORA-26216", ERR_SESSIONLESS_ALREADY_ACTIVE);
236
263
 
237
264
  // define mapping for error messages
238
265
  const messages = new Map();
@@ -247,7 +274,7 @@ messages.set(ERR_INVALID_PARAMETER_VALUE, // NJS-005
247
274
  messages.set(ERR_INVALID_PROPERTY_VALUE_IN_PARAM, // NJS-007
248
275
  'invalid value for "%s" in parameter %d');
249
276
  messages.set(ERR_INVALID_NUMBER_OF_PARAMETERS, // NJS-009
250
- 'invalid number of parameters');
277
+ 'invalid number of function parameters: %d provided but expected between %d and %d');
251
278
  // used in C -- keep synchronized!
252
279
  messages.set(ERR_UNSUPPORTED_DATA_TYPE, // NJS-010
253
280
  'unsupported data type %d in column %d');
@@ -473,7 +500,7 @@ messages.set(ERR_INVALID_TPC_END_FLAGS, // NJS-151
473
500
  messages.set(ERR_UNKNOWN_TRANSACTION_STATE, // NJS-152
474
501
  'internal error: unknown transaction state {state} in Two Phase Commit');
475
502
  messages.set(ERR_INVALID_TRANSACTION_SIZE, // NJS-153
476
- 'size of the transaction ID is %d and cannot exceed 64');
503
+ 'size of the transaction ID must be non-zero and must not exceed 64. Its current size is %d.');
477
504
  messages.set(ERR_INVALID_BRANCH_SIZE, // NJS-154
478
505
  'size of the branch ID is %d and cannot exceed 64');
479
506
  messages.set(ERR_OPERATION_NOT_SUPPORTED_ON_BFILE, // NJS-155
@@ -498,19 +525,25 @@ messages.set(ERR_VECTOR_SPARSE_INVALID_INPUT, // NJS-164
498
525
  'SPARSE VECTOR Invalid Input Data');
499
526
  messages.set(ERR_VECTOR_SPARSE_INDICES_ELEM_IS_NOT_VALID, // NJS-165
500
527
  'SPARSE VECTOR indices element at index %d is not valid');
501
- messages.set(ERR_DB_FETCH_TYPE_HANDLER_CONVERTER, // NJS-166
528
+ messages.set(ERR_DB_FETCH_TYPE_HANDLER_CONVERTER, // NJS-166
502
529
  'DBFetchTypeHandler return value attribute "converter" must be a function');
503
- messages.set(ERR_DB_FETCH_TYPE_HANDLER_RETURN_VALUE, // NJS-167
530
+ messages.set(ERR_DB_FETCH_TYPE_HANDLER_RETURN_VALUE, // NJS-167
504
531
  'DBFetchTypeHandler return value must be an object');
505
532
  messages.set(ERR_ACCESS_TOKEN, // NJS-168
506
533
  'access token function failed.');
507
- messages.set(ERR_CALLOUT_FN, // NJS-169
534
+ messages.set(ERR_CALLOUT_FN, // NJS-169
508
535
  'External function call failed.');
536
+ messages.set(ERR_SESSIONLESS_DIFFERING_METHODS, //NJS-170
537
+ 'Different ways to start or suspend sessionless transactions are being used(server procedures and client APIs)');
538
+ messages.set(ERR_SESSIONLESS_ALREADY_ACTIVE, //NJS-171
539
+ 'Suspend, commit or rollback the currently active sessionless transaction before beginning or resuming another one.');
540
+ messages.set(ERR_SESSIONLESS_INACTIVE, //NJS-172
541
+ 'No sessionless transaction is active');
509
542
 
510
543
  // Oracle Net layer errors
511
544
 
512
545
  messages.set(ERR_CONNECTION_CLOSED, // NJS-500
513
- 'connection to the Oracle Database was broken');
546
+ 'connection to Oracle Database was closed or broken');
514
547
  messages.set(ERR_CONNECTION_LOSTCONTACT, // NJS-501
515
548
  'connection to host %s port %d terminated unexpectedly. (CONNECTION_ID=%s)\n%s');
516
549
  messages.set(ERR_CONNECTION_INCOMPLETE, // NJS-503
@@ -551,20 +584,10 @@ messages.set(ERR_TNS_NAMES_FILE_MISSING, // NJS-520
551
584
  'cannot connect to Oracle Database. File tnsnames.ora not found in %s');
552
585
  messages.set(ERR_CONNECTION_EOF, // NJS-521
553
586
  'connection to host %s port %d received end-of-file on communication channel. (CONNECTION_ID=%s)');
554
- messages.set(ERR_AZURE_CONFIG_PROVIDER_AUTH_FAILED, // NJS-522
555
- 'Azure Authentication Failed: The authentication parameter value %s may be incorrect');
556
587
  messages.set(ERR_CONFIG_PROVIDER_FAILED_TO_RETRIEVE_CONFIG, // NJS-523
557
588
  'Failed to retrieve configuration from Centralized Configuration Provider:\n %s');
558
- messages.set(ERR_CONFIG_PROVIDER_NOT_SUPPORTED, // NJS-524
559
- 'Configuration Provider not supported: %s');
560
- messages.set(ERR_CONFIG_PROVIDER_LOAD_FAILED, // NJS-525
561
- 'Centralized Config Provider failed to load required libraries. Please install the required libraries.\n %s');
562
- messages.set(ERR_OCIOBJECT_CONFIG_PROVIDER_AUTH_FAILED, // NJS-526
563
- 'OCI authentication failed: The authentication parameter value %s may be incorrect');
564
- messages.set(ERR_AZURE_VAULT_AUTH_FAILED, // NJS-527
565
- 'Azure Vault: Provide correct Azure Vault authentication details');
566
- messages.set(ERR_AZURE_SERVICE_PRINCIPAL_AUTH_FAILED, // NJS-528
567
- 'Azure service principal authentication requires either a client certificate path or a client secret string');
589
+ messages.set(ERR_REGISTER_HOOKFN_CONFIGPROVIDER, // NJS-524
590
+ '%s Configuration provider plugin not registered. Please register the hook function for the same');
568
591
  messages.set(ERR_WALLET_TYPE_NOT_SUPPORTED, // NJS-529
569
592
  'Invalid wallet content format. Supported format is PEM');
570
593
  messages.set(ERR_HOST_NOT_FOUND, // NJS-530
@@ -577,6 +600,8 @@ messages.set(ERR_ANO_NEGOTIATION, // NJS-533
577
600
  'Advanced Networking Option service negotiation failed. Native Network Encryption and DataIntegrity only supported in node-oracledb thick mode.\nCause: ORA-%s');
578
601
  messages.set(ERR_DATA_COMPRESSION, 'Error during data compression/decompression: %s\n'); //NJS-534
579
602
  // Oracle SUCCESS_WITH_INFO warning
603
+ messages.set(ERR_CONFIG_PROVIDER_PARAM_TYPE, // NJS-535
604
+ 'Parameter does not have a valid type: %s\n');
580
605
  messages.set(WRN_COMPILATION_CREATE, // NJS-700
581
606
  'creation succeeded with compilation errors');
582
607
 
@@ -601,7 +626,7 @@ function assert(condition) {
601
626
  //-----------------------------------------------------------------------------
602
627
  function assertArgCount(args, minArgCount, maxArgCount) {
603
628
  assert(args.length >= minArgCount && args.length <= maxArgCount,
604
- ERR_INVALID_NUMBER_OF_PARAMETERS);
629
+ ERR_INVALID_NUMBER_OF_PARAMETERS, args.length, minArgCount, maxArgCount);
605
630
  }
606
631
 
607
632
  //-----------------------------------------------------------------------------
@@ -728,6 +753,7 @@ function getErr(errorNum) {
728
753
  args[0] = `${code}: ${baseText}`;
729
754
  const err = new Error(util.format(...args));
730
755
  err.code = code;
756
+ err.isRecoverable = (errorNum === ERR_CONNECTION_CLOSED);
731
757
  Error.captureStackTrace(err, getErr);
732
758
  return err;
733
759
  }
@@ -904,13 +930,9 @@ module.exports = {
904
930
  ERR_NO_CONFIG_DIR,
905
931
  ERR_TNS_ENTRY_NOT_FOUND,
906
932
  ERR_CONNECTION_EOF,
907
- ERR_AZURE_CONFIG_PROVIDER_AUTH_FAILED,
908
- ERR_OCIOBJECT_CONFIG_PROVIDER_AUTH_FAILED,
909
- ERR_AZURE_VAULT_AUTH_FAILED,
910
- ERR_AZURE_SERVICE_PRINCIPAL_AUTH_FAILED,
911
933
  ERR_CONFIG_PROVIDER_FAILED_TO_RETRIEVE_CONFIG,
912
- ERR_CONFIG_PROVIDER_NOT_SUPPORTED,
913
- ERR_CONFIG_PROVIDER_LOAD_FAILED,
934
+ ERR_CONFIG_PROVIDER_PARAM_TYPE,
935
+ ERR_REGISTER_HOOKFN_CONFIGPROVIDER,
914
936
  ERR_DATA_COMPRESSION,
915
937
  ERR_WALLET_TYPE_NOT_SUPPORTED,
916
938
  ERR_HOST_NOT_FOUND,
@@ -974,6 +996,9 @@ module.exports = {
974
996
  ERR_UNKNOWN_TRANSACTION_STATE,
975
997
  ERR_INVALID_TRANSACTION_SIZE,
976
998
  ERR_INVALID_BRANCH_SIZE,
999
+ ERR_SESSIONLESS_DIFFERING_METHODS,
1000
+ ERR_SESSIONLESS_ALREADY_ACTIVE,
1001
+ ERR_SESSIONLESS_INACTIVE,
977
1002
  ERR_CONNECTION_CLOSED_CODE: `${ERR_PREFIX}-${ERR_CONNECTION_CLOSED}`,
978
1003
  ERR_OPERATION_NOT_SUPPORTED_ON_BFILE,
979
1004
  ERR_OPERATION_ONLY_SUPPORTED_ON_BFILE,
@@ -289,6 +289,15 @@ class ConnectionImpl {
289
289
  errors.throwNotImplemented("getting the internal name");
290
290
  }
291
291
 
292
+ //---------------------------------------------------------------------------
293
+ // getLTXID()
294
+ //
295
+ // Returns the the logical transaction ID for database transactions.
296
+ //---------------------------------------------------------------------------
297
+ getLTXID() {
298
+ errors.throwNotImplemented("getting the logical transaction id");
299
+ }
300
+
292
301
  //---------------------------------------------------------------------------
293
302
  // getMaxIdentifierLength()
294
303
  //
package/lib/impl/pool.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2022, Oracle and/or its affiliates.
1
+ // Copyright (c) 2022, 2025, Oracle and/or its affiliates.
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
@@ -165,6 +165,15 @@ class PoolImpl {
165
165
  errors.throwNotImplemented("getting the pool timeout");
166
166
  }
167
167
 
168
+ //---------------------------------------------------------------------------
169
+ // getMaxLifetimeSession()
170
+ //
171
+ // Returns the pool max lifetime for a session.
172
+ //---------------------------------------------------------------------------
173
+ getMaxLifetimeSession() {
174
+ errors.throwNotImplemented("getting the pool max lifetime");
175
+ }
176
+
168
177
  //---------------------------------------------------------------------------
169
178
  // getStmtCacheSize()
170
179
  //
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2022, 2023, Oracle and/or its affiliates.
1
+ // Copyright (c) 2022, 2025, Oracle and/or its affiliates.
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
@@ -43,8 +43,9 @@ class ResultSetImpl extends BaseImpl {
43
43
  // _determineFetchType()
44
44
  //
45
45
  // Determine the fetch type to use for the specified metadata.
46
+ // Param rowsetMetaData includes metadata of all the columns fetched.
46
47
  //---------------------------------------------------------------------------
47
- _determineFetchType(metadata, options) {
48
+ _determineFetchType(metadata, options, rowsetMetaData) {
48
49
 
49
50
  // clear any previous fetch type and converter functions that may have been
50
51
  // retained
@@ -54,7 +55,7 @@ class ResultSetImpl extends BaseImpl {
54
55
  // if a fetch type handler is specified, call it; if no value (undefined)
55
56
  // is returned, the normal processing takes place
56
57
  if (options.fetchTypeHandler) {
57
- const result = options.fetchTypeHandler(metadata);
58
+ const result = options.fetchTypeHandler(metadata, rowsetMetaData);
58
59
  if (result !== undefined) {
59
60
  errors.assert(typeof result === 'object',
60
61
  errors.ERR_FETCH_TYPE_HANDLER_RETURN_VALUE);
@@ -232,7 +233,7 @@ class ResultSetImpl extends BaseImpl {
232
233
  info.dbTypeClass = cls;
233
234
  }
234
235
  nodbUtil.addTypeProperties(info, "dbType");
235
- this._determineFetchType(info, options);
236
+ this._determineFetchType(info, options, metaData);
236
237
  if (info.fetchType === types.DB_TYPE_CURSOR) {
237
238
  this.nestedCursorIndices.push(i);
238
239
  } else if (info.fetchType === types.DB_TYPE_CLOB ||
package/lib/lob.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2016, 2024, Oracle and/or its affiliates.
1
+ // Copyright (c) 2016, 2025, Oracle and/or its affiliates.
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
@@ -246,6 +246,14 @@ class Lob extends Duplex {
246
246
  this._checkIsBfile();
247
247
  errors.assertArgCount(arguments, 1, 1);
248
248
  errors.assertParamValue(nodbUtil.isObject(a1), 1);
249
+ errors.assertParamValue(Object.hasOwn(a1, "dirName"), 1);
250
+ errors.assertParamValue(Object.hasOwn(a1, "fileName"), 1);
251
+ errors.assertPropValue(
252
+ a1.dirName != "" && a1.dirName != null, "dirName"
253
+ );
254
+ errors.assertPropValue(
255
+ a1.fileName != "" && a1.fileName != null, "fileName"
256
+ );
249
257
  this._impl.setDirFileName(a1);
250
258
  }
251
259