@@ -955,9 +955,11 @@ writeonly String action
955
955
```
956
956
957
957
The [ action] ( https://docs.oracle.com/database/121/LNOCI/oci08sca.htm#sthref1434 )
958
- attribute for end-to-end application tracing. This is a write-only property.
958
+ attribute for end-to-end application tracing.
959
959
960
- See [ End-to-end Tracing, Mid-tier Authentication, and Auditing] ( #endtoend ) .
960
+ This is a write-only property. Displaying a Connection object will
961
+ show a value of ` null ` for this attribute. See
962
+ [ End-to-end Tracing, Mid-tier Authentication, and Auditing] ( #endtoend ) .
961
963
962
964
#### <a name =" propconnclientid " ></a > 4.1.2 clientId
963
965
@@ -969,9 +971,10 @@ The [client
969
971
identifier] ( https://docs.oracle.com/database/121/LNOCI/oci08sca.htm#sthref1414 )
970
972
for end-to-end application tracing, use with mid-tier authentication,
971
973
and with [ Virtual Private Databases] ( http://docs.oracle.com/database/121/CNCPT/cmntopc.htm#CNCPT62345 ) .
972
- This is a write-only property.
973
974
974
- See [ End-to-end Tracing, Mid-tier Authentication, and Auditing] ( #endtoend ) .
975
+ This is a write-only property. Displaying a Connection object will
976
+ show a value of ` null ` for this attribute. See
977
+ [ End-to-end Tracing, Mid-tier Authentication, and Auditing] ( #endtoend ) .
975
978
976
979
#### <a name =" propconnmodule " ></a > 4.1.3 module
977
980
@@ -980,9 +983,11 @@ writeonly String module
980
983
```
981
984
982
985
The [ module] ( https://docs.oracle.com/database/121/LNOCI/oci08sca.htm#sthref1433 )
983
- attribute for end-to-end application tracing. This is a write-only property.
986
+ attribute for end-to-end application tracing.
984
987
985
- See [ End-to-end Tracing, Mid-tier Authentication, and Auditing] ( #endtoend ) .
988
+ This is a write-only property. Displaying a Connection object will
989
+ show a value of ` null ` for this attribute. See
990
+ [ End-to-end Tracing, Mid-tier Authentication, and Auditing] ( #endtoend ) .
986
991
987
992
#### <a name =" propconnstmtcachesize " ></a > 4.1.4 stmtCacheSize
988
993
@@ -3303,7 +3308,7 @@ own mid-tier authentication but connect to the database using the one
3303
3308
database schema. By setting ` clientId` to the application's
3304
3309
authenticated username, the database is aware of who the actual end
3305
3310
user is. This can, for example, be used by Oracle
3306
- [Virtual Private Databases ](http://docs.oracle.com/database/121/CNCPT/cmntopc.htm#CNCPT62345)
3311
+ [Virtual Private Database ](http://docs.oracle.com/database/121/CNCPT/cmntopc.htm#CNCPT62345)
3307
3312
policies to automatically restrict data access by that user.
3308
3313
3309
3314
Applications should set the properties because they can greatly help
@@ -3349,14 +3354,33 @@ The values can also be manually set by calling
3349
3354
[` DBMS_APPLICATION_INFO ` ](http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_appinf.htm#CHECEIEB)
3350
3355
procedures or
3351
3356
[` DBMS_SESSION .SET_IDENTIFIER ` ](http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_sessio.htm#SET_IDENTIFIER),
3352
- however these require explicit round-trips, reducing scalability.
3357
+ however these cause explicit round-trips, reducing scalability.
3358
+
3359
+ In general, applications should be consistent about how, and when,
3360
+ they set the end-to-end tracing attributes so that current values are
3361
+ recorded by the database.
3353
3362
3354
3363
Idle connections released back to a connection pool will retain the
3355
- previous attribute values of that connection. This avoids the
3356
- overhead of a round-trip to reset the values. After calling
3357
- ` pool .getConnection ()` , the application should be consistent about
3358
- setting appropriate values to ensure any previous values are updated.
3359
- The Oracle design assumption is that pools are actively used and have
3360
- few idle connections. However, if desired, the application can set
3361
- the properties to empty strings and force a round-trip prior to
3362
- connection release. This reduces efficiency.
3364
+ previous attribute values of that connection. This avoids the overhead
3365
+ of a round-trip to reset the values. The Oracle design assumption is
3366
+ that pools are actively used and have few idle connections. After
3367
+ getting a connection from a pool, an application that uses end-to-end
3368
+ tracing should set new values appropriately.
3369
+
3370
+ When a Connection object is displayed, such as with ` console .log ()` ,
3371
+ the end-to-end tracing attributes will show as ` null ` even if values
3372
+ have been set and are being sent to the database. This is for
3373
+ architectural, efficiency and consistency reasons. When an already
3374
+ established connection is retrieved from a local pool, node-oracledb
3375
+ is not able to efficiently retrieve values previously established in
3376
+ the connection. The same occurs if the values are set by a call to
3377
+ PL/SQL code - there is no efficient way for node-oracledb to know the
3378
+ values have changed.
3379
+
3380
+ The attribute values are commonly useful to DBAs. However, if knowing
3381
+ the current values is useful in an application, the application should
3382
+ save the values as part of its application state whenever the
3383
+ node-oracledb attributes are set. Applications can also find the
3384
+ current values by querying the Oracle data dictionary or using PL/SQL
3385
+ procedures such as ` DBMS_APPLICATION_INFO .READ_MODULE ()` with the
3386
+ understanding that these require round-trips to the database.
0 commit comments