@@ -138,12 +138,14 @@ For installation information, see the [Node-oracledb Installation Instructions][
138
138
- 4.1.1 [`action`](#propconnaction)
139
139
- 4.1.2 [`callTimeout`](#propconncalltimeout)
140
140
- 4.1.3 [`clientId`](#propconnclientid)
141
- - 4.1.4 [`currentSchema`](#propconncurrentschema)
142
- - 4.1.5 [`module`](#propconnmodule)
143
- - 4.1.6 [`oracleServerVersion`](#propconnoracleserverversion)
144
- - 4.1.7 [`oracleServerVersionString`](#propconnoracleserverversionstring)
145
- - 4.1.8 [`stmtCacheSize`](#propconnstmtcachesize)
146
- - 4.1.9 [`tag`](#propconntag)
141
+ - 4.1.4 [`clientInfo`](#propconnclientinfo)
142
+ - 4.1.5 [`currentSchema`](#propconncurrentschema)
143
+ - 4.1.6 [`dbOp`](#propconndbop)
144
+ - 4.1.7 [`module`](#propconnmodule)
145
+ - 4.1.8 [`oracleServerVersion`](#propconnoracleserverversion)
146
+ - 4.1.9 [`oracleServerVersionString`](#propconnoracleserverversionstring)
147
+ - 4.1.10 [`stmtCacheSize`](#propconnstmtcachesize)
148
+ - 4.1.11 [`tag`](#propconntag)
147
149
- 4.2 [Connection Methods](#connectionmethods)
148
150
- 4.2.1 [`break()`](#break)
149
151
- 4.2.2 [`changePassword()`](#changepassword)
@@ -2442,11 +2444,25 @@ The [client identifier][10] for end-to-end application tracing, use
2442
2444
with mid-tier authentication, and with [Virtual Private
2443
2445
Databases][11].
2444
2446
2445
- This is a write-only property. Displaying a Connection object will
2446
- show a value of `null` for this attribute. See
2447
- [End-to-end Tracing, Mid-tier Authentication, and Auditing](#endtoend).
2447
+ This is a write-only property. Displaying `Connection.clientId` will show a
2448
+ value of `null`. See [End-to-end Tracing, Mid-tier Authentication, and
2449
+ Auditing](#endtoend).
2450
+
2451
+ #### <a name="propconnclientinfo"></a> 4.1.4 `connection.clientInfo`
2452
+
2453
+ ```
2454
+ writeonly String clientInfo
2455
+ ```
2456
+
2457
+ The client information for end-to-end application tracing.
2458
+
2459
+ This is a write-only property. Displaying `Connection.clientInfo` will show a
2460
+ value of `null`. See [End-to-end Tracing, Mid-tier Authentication, and
2461
+ Auditing](#endtoend).
2448
2462
2449
- #### <a name="propconncurrentschema"></a> 4.1.4 `connection.currentSchema`
2463
+ This property was added in node-oracledb 4.1.
2464
+
2465
+ #### <a name="propconncurrentschema"></a> 4.1.5 `connection.currentSchema`
2450
2466
2451
2467
```
2452
2468
String currentSchema
@@ -2468,19 +2484,33 @@ CURRENT_SCHEMA`][137].
2468
2484
2469
2485
This property was added in node-oracledb 4.0.
2470
2486
2471
- #### <a name="propconnmodule"></a> 4.1.5 `connection.module`
2487
+ #### <a name="propconndbop"></a> 4.1.6 `connection.dbOp`
2488
+
2489
+ ```
2490
+ writeonly String dbOp
2491
+ ```
2492
+
2493
+ The database operation information for end-to-end application tracing.
2494
+
2495
+ This is a write-only property. Displaying `Connection.dbOp` will show a value
2496
+ of `null`. See [End-to-end Tracing, Mid-tier Authentication, and
2497
+ Auditing](#endtoend).
2498
+
2499
+ This property was added in node-oracledb 4.1. It is available with Oracle 12c.
2500
+
2501
+ #### <a name="propconnmodule"></a> 4.1.7 `connection.module`
2472
2502
2473
2503
```
2474
2504
writeonly String module
2475
2505
```
2476
2506
2477
2507
The [module][9] attribute for end-to-end application tracing.
2478
2508
2479
- This is a write-only property. Displaying a Connection object will
2480
- show a value of `null` for this attribute. See
2481
- [End-to-end Tracing, Mid-tier Authentication, and Auditing](#endtoend).
2509
+ This is a write-only property. Displaying ` Connection.module` will show a value
2510
+ of `null`. See [End-to-end Tracing, Mid-tier Authentication, and
2511
+ Auditing](#endtoend).
2482
2512
2483
- #### <a name="propconnoracleserverversion"></a> 4.1.6 `connection.oracleServerVersion`
2513
+ #### <a name="propconnoracleserverversion"></a> 4.1.8 `connection.oracleServerVersion`
2484
2514
2485
2515
```
2486
2516
readonly Number oracleServerVersion
@@ -2496,7 +2526,7 @@ instead of 1803000000.
2496
2526
2497
2527
This property was added in node-oracledb 1.3.
2498
2528
2499
- #### <a name="propconnoracleserverversionstring"></a> 4.1.7 `connection.oracleServerVersionString`
2529
+ #### <a name="propconnoracleserverversionstring"></a> 4.1.9 `connection.oracleServerVersionString`
2500
2530
2501
2531
```
2502
2532
readonly String oracleServerVersionString
@@ -2511,7 +2541,7 @@ release such as "18.0.0.0.0" instead of "18.3.0.0.0".
2511
2541
2512
2542
This property was added in node-oracledb 2.2.
2513
2543
2514
- #### <a name="propconnstmtcachesize"></a> 4.1.8 `connection.stmtCacheSize`
2544
+ #### <a name="propconnstmtcachesize"></a> 4.1.10 `connection.stmtCacheSize`
2515
2545
2516
2546
```
2517
2547
readonly Number stmtCacheSize
@@ -2522,7 +2552,7 @@ The number of statements to be cached in the
2522
2552
the `stmtCacheSize` property in effect in the *Pool* object when the
2523
2553
connection is created in the pool.
2524
2554
2525
- #### <a name="propconntag"></a> 4.1.9 `connection.tag`
2555
+ #### <a name="propconntag"></a> 4.1.11 `connection.tag`
2526
2556
2527
2557
```
2528
2558
String tag
@@ -12690,10 +12720,10 @@ In node-oracledb this will always show AL32UTF8.
12690
12720
12691
12721
## <a name="endtoend"></a> 28. End-to-end Tracing, Mid-tier Authentication, and Auditing
12692
12722
12693
- The Connection properties [action](#propconnaction),
12694
- [module ](#propconnmodule ), and [clientId ](#propconnclientid) set
12695
- metadata for [end-to-end tracing][70]. The values can be tracked in
12696
- database views, shown in audit trails, and seen in tools such as
12723
+ The Connection properties [action](#propconnaction), [module](#propconnmodule),
12724
+ [clientId ](#propconnclientid ), [clientInfo ](#propconnclientinfo) and
12725
+ [dbOp](#propconndbop) set metadata for [end-to-end tracing][70]. The values can
12726
+ be tracked in database views, shown in audit trails, and seen in tools such as
12697
12727
Enterprise Manager.
12698
12728
12699
12729
The `clientId` property can also be used by applications that do their
@@ -12722,28 +12752,38 @@ const connection = await oracledb.getConnection(
12722
12752
);
12723
12753
12724
12754
connection.clientId = "Chris";
12755
+ connection.clientInfo = "My demo application";
12725
12756
connection.module = "End-to-end example";
12726
12757
connection.action = "Query departments";
12758
+ connection.dbOp = "Billing"
12727
12759
12728
12760
const result = await connection.execute(`SELECT . . .`);
12729
12761
```
12730
12762
12731
12763
While the connection is open the attribute values can be seen, for example with SQL*Plus:
12732
12764
12733
12765
```
12734
- SQL> SELECT username, client_identifier, action, module FROM v$session WHERE username = 'HR';
12766
+ SQL> SELECT username, client_identifier, client_info, action, module FROM v$session WHERE username = 'HR';
12767
+
12768
+ USERNAME CLIENT_IDENTIFIER CLIENT_INFO ACTION MODULE
12769
+ ---------- -------------------- ---------------------- -------------------- --------------------
12770
+ HR Chris My demo application Query departments End-to-end example
12735
12771
12736
- USERNAME CLIENT_IDENTIFIER ACTION MODULE
12737
- ---------- -------------------- -------------------- --------------------
12738
- HR Chris Query departments End-to-end example
12772
+ SQL> SELECT dbop_name FROM v$sql_monitor;
12773
+ DBOP_NAME
12774
+ ------------------------------
12775
+ Billing
12776
+ . . .
12739
12777
```
12740
12778
12741
- The values can also be manually set by calling
12742
- [`DBMS_APPLICATION_INFO`][71] procedures or
12743
- [`DBMS_SESSION.SET_IDENTIFIER`][72], however these cause explicit
12744
- [round-trips](#roundtrips), reducing scalability.
12779
+ Other ways to access metadata include querying `V$SQLAREA` and `sys_context()`,
12780
+ for example `SELECT SYS_CONTEXT('userenv', 'client_info') FROM dual`.
12781
+
12782
+ Metadata values can also be manually set by calling
12783
+ [`DBMS_APPLICATION_INFO`][71] procedures or [`DBMS_SESSION.SET_IDENTIFIER`][72],
12784
+ however these cause explicit [round-trips](#roundtrips), reducing scalability.
12745
12785
12746
- In general, applications should be consistent about how, and when,
12786
+ Applications should be consistent about how, and when,
12747
12787
they set the end-to-end tracing attributes so that current values are
12748
12788
recorded by the database.
12749
12789
@@ -12786,8 +12826,8 @@ SQL> SELECT UNIQUE sid, client_driver
12786
12826
12787
12827
SID CLIENT_DRIVER
12788
12828
---------- ------------------------------
12789
- 16 node-oracledb : 2.2 .0
12790
- 33 node-oracledb : 2.2 .0
12829
+ 16 node-oracledb : 4.1 .0
12830
+ 33 node-oracledb : 4.1 .0
12791
12831
```
12792
12832
12793
12833
Note if [`oracledb.connectionClass`](#propdbconclass) is set for a
0 commit comments