|
25 | 25 | * The user must have been granted CHANGE NOTIFICATION.
|
26 | 26 | * The node-oracledb host must be resolvable by the database host.
|
27 | 27 | *
|
28 |
| - * Run this script and when the subscription has been created, run |
| 28 | + * Run this script and then, after the subscription has been created, run |
29 | 29 | * these statements in a SQL*Plus session:
|
30 | 30 | * INSERT INTO NO_CQNTABLE VALUES (101);
|
31 | 31 | * COMMIT;
|
@@ -98,11 +98,13 @@ const options = {
|
98 | 98 | callback : myCallback,
|
99 | 99 | sql: `SELECT * FROM no_cqntable WHERE k > :bv`,
|
100 | 100 | binds: { bv : 100 },
|
101 |
| - timeout : 60, // Stop after 60 seconds |
102 |
| - // ipAddress: '127.0.0.1', |
103 |
| - // SUBSCR_QOS_QUERY: generate notifications when rows with k > 100 are changed |
104 |
| - // SUBSCR_QOS_ROWIDS: Return ROWIDs in the notification message |
105 |
| - qos : oracledb.SUBSCR_QOS_QUERY | oracledb.SUBSCR_QOS_ROWIDS |
| 101 | + timeout: 60, // stop after 60 seconds |
| 102 | + clientInitiated: true, // for Oracle Database & Client 19.4 or later |
| 103 | + // ipAddress: '127.0.0.1', // where Node.js runs (when not using clientInitiated) |
| 104 | + // qos flags: |
| 105 | + // SUBSCR_QOS_QUERY: generate notifications when rows with k > 100 are changed |
| 106 | + // SUBSCR_QOS_ROWIDS: return ROWIDs in the notification message |
| 107 | + qos: oracledb.SUBSCR_QOS_QUERY | oracledb.SUBSCR_QOS_ROWIDS |
106 | 108 | };
|
107 | 109 |
|
108 | 110 | async function setup(connection) {
|
|
0 commit comments