Skip to content

Commit f03daf7

Browse files
committed
Adjust offset property to be 32-bit instead of 16-bit
1 parent b9d284d commit f03daf7

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
to `execute()`. It contains the ROWID of the last row affected by an INSERT,
1313
UPDATE, DELETE or MERGE statement.
1414

15+
- Changed the Error object
16+
[`offset`](https://oracle.github.io/node-oracledb/doc/api.html#properroffset)
17+
to be 32-bit, allowing the
18+
[`batchErrors`](https://oracle.github.io/node-oracledb/doc/api.html#executemanyoptbatcherrors)
19+
mode of `executeMany()` to show row `offset` values up to (2^32)-1 ([ODPI-C
20+
change](https://github.com/oracle/odpi/commit/294d5966cd513d0c29fdeec3bbbdfad376f81d4f)).
21+
1522
- Fixed various execution failures with Node.js 13.2 due to Node.js NULL pointer behavior change ([ODPI-C
1623
change](https://github.com/oracle/odpi/commit/7693865bb6a98568546aa319cc0fdb9e208cf9d4)).
1724

doc/api.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# node-oracledb 4.2 Documentation for the Oracle Database Node.js Add-on
22

3-
*Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.*
3+
*Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.*
44

55
You may not use the identified files except in compliance with the Apache
66
License, Version 2.0 (the "License.")
@@ -722,11 +722,12 @@ contexts. This value is undefined for non-Oracle errors and for
722722
messages prefixed with NJS or DPI.
723723

724724
When [`batchErrors`](#executemanyoptbatcherrors) mode in
725-
[`executeMany()`](#executemany) returns an array of Error objects in
726-
the callback result parameter, each `offset` property is a 0-based
727-
index corresponding to the `executeMany()` [binds
728-
parameter](#executemanybinds) array, indicating which record could not
729-
be processed. See [Handling Data Errors](#handlingbatcherrors).
725+
[`executeMany()`](#executemany) returns an array of Error objects in the
726+
callback result parameter, each `offset` property is a 0-based index
727+
corresponding to the `executeMany()` [binds parameter](#executemanybinds) array,
728+
indicating which record could not be processed. See [Handling Data
729+
Errors](#handlingbatcherrors). In node-oracledb 4.2, the maximum `offset` value
730+
was changed from (2^16)-1 to (2^32)-1.
730731

731732
## <a name="oracledbclass"></a> 3. Oracledb Class
732733

@@ -3420,21 +3421,25 @@ while still letting valid data be processed. It can only be set
34203421
When *false*, the `executeMany()` call will stop when the first error
34213422
occurs. The callback [error object](#errorobj) will be set.
34223423

3423-
When `batchErrors` is *true*, processing will continue even if there
3424-
are data errors. The `executeMany()` callback error parameter is not
3425-
set. Instead, an array containing an error per input data record will
3426-
be returned in the callback `result` parameter. All valid data
3427-
records will be processed and a transaction will be started but not
3428-
committed, even if `autoCommit` is *true*. The application can
3429-
examine the errors, take action, and explicitly commit or rollback as
3430-
desired.
3424+
When `batchErrors` is *true*, processing will continue even if there are data
3425+
errors. The `executeMany()` callback error parameter is not set. Instead, a
3426+
property (also called `batchErrors`) will be returned in the callback `result`
3427+
parameter. The property holds an array of [Error objects](#errorobj). Each Error
3428+
`offset` indicates the row number of a data record that could not be
3429+
processed. All other valid data records will be processed and a transaction
3430+
will be started but not committed, even if `autoCommit` is *true*. The
3431+
application can examine the errors, take action, and explicitly commit or
3432+
rollback as desired. In node-oracledb 4.2, the maximum `offset` value
3433+
was changed from (2^16)-1 to (2^32)-1.
34313434

34323435
Note that some classes of error will always return via the
34333436
`executeMany()` callback error object, not as batch errors. No
34343437
transaction is created in this case.
34353438

34363439
The default value is *false*.
34373440

3441+
See [Handling Data Errors with `executeMany()`](#handlingbatcherrors) for examples.
3442+
34383443
###### <a name="executemanyoptbinddefs"></a> 4.2.7.3.3 `bindDefs`
34393444

34403445
```

0 commit comments

Comments
 (0)