Skip to content

Commit e726c93

Browse files
committed
Add more CQN doc
1 parent c1c79af commit e726c93

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

doc/api.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3110,7 +3110,7 @@ The `message` parameter in the notification callback is an object containing the
31103110
- `rowid` - a string containing the ROWID of the row that was affected
31113111
- `txId` - a buffer containing the identifier of the transaction which spawned the notification.
31123112
- `type` - the type of notification sent. This will be the value of one of the following constants:
3113-
- [`oracledb.SUBSCR_EVENT_TYPE_AQ`](#oracledbconstantssubscription) - One or more Advanced Queuing messages are available for to be dequeued (Note AQ enqueue and dequeue methods are not supported)
3113+
- [`oracledb.SUBSCR_EVENT_TYPE_AQ`](#oracledbconstantssubscription) - One or more Advanced Queuing messages are available to be dequeued (Note AQ enqueue and dequeue methods are not supported)
31143114
- [`oracledb.SUBSCR_EVENT_TYPE_DEREG`](#oracledbconstantssubscription) - the subscription has been closed or the timeout value has been reached.
31153115
- [`oracledb.SUBSCR_EVENT_TYPE_OBJ_CHANGE`](#oracledbconstantssubscription) - object-level notications are being used (Database Change Notification).
31163116
- [`oracledb.SUBSCR_EVENT_TYPE_QUERY_CHANGE`](#oracledbconstantssubscription) - query-level notifications are being used (Continuous Query Notification).
@@ -7957,10 +7957,11 @@ The connection must be created with [`events`](#propdbevents) mode
79577957
79587958
The database must be able to connect to the node-oracledb machine for
79597959
notifications to be received. Typically this means that the machine
7960-
running node-oracledb needs a fixed IP address. If there is any
7961-
problem sending a notification, then the callback method will not be
7962-
invoked. The configuration options can include an
7963-
[`ipAddress`](#consubscribeoptipaddress) and
7960+
running node-oracledb needs a fixed IP address. Note
7961+
`connection.subscribe()` does not verify that this reverse connection
7962+
is possible. If there is any problem sending a notification, then the
7963+
callback method will not be invoked. The configuration options can
7964+
include an [`ipAddress`](#consubscribeoptipaddress) and
79647965
[`port`](#consubscribeoptport) on which to listen for notifications,
79657966
otherwise the database chooses values.
79667967
@@ -7986,9 +7987,14 @@ connection.subscribe('mysub', options, function(err) { ... } );
79867987
In this example, whenever a change to `mytable` is committed then
79877988
`myCallback()` is invoked. The callback
79887989
[`message`](#consubscribeoptcallback) parameter contains information
7989-
about the notification. The information and notification behavior is
7990-
widely configurable by the subscription
7991-
[`options`](#consubscribeoptions).
7990+
about the notification.
7991+
7992+
CQN notification behavior is widely configurable by the subscription
7993+
[`options`](#consubscribeoptions). Choices include specifying what
7994+
types of SQL should trigger a notification, whether notifications
7995+
should survive database loss, and control over unsubscription. You
7996+
can also choose whether notification messages will include ROWIDs of
7997+
affected rows.
79927998
79937999
The `connection.subscribe()` method may be called multiple times with
79948000
the same `name`. In this case, the second and subsequent invocations
@@ -7999,6 +8005,9 @@ and the same JavaScript notification callback is used. For
79998005
performance reasons this can be preferable to creating a new
80008006
subscription for each query.
80018007
8008+
You can view information about registrations by querying
8009+
`USER_CHANGE_NOTIFICATION_REGS` table.
8010+
80028011
When notifications are no longer required, the subscription name can
80038012
be passed to [`connection.unsubscribe()`](#conunsubscribe).
80048013
@@ -8782,4 +8791,4 @@ When upgrading from node-oracledb version 2.0 to version 2.1:
87828791
[96]: https://docs.oracle.com/en/database/oracle/oracle-database/12.2/ladbi/standard-oracle-database-groups-for-database-administrators.html#GUID-0A789F28-169A-43D6-9E48-AAE20D7B0C44
87838792
[97]: http://www.oracle.com/technetwork/database/options/clustering/applicationcontinuity/learnmore/fastapplicationnotification12c-2538999.pdf
87848793
[98]: https://docs.oracle.com/en/database/oracle/oracle-database/18/adfns/editions.html#GUID-58DE05A0-5DEF-4791-8FA8-F04D11964906
8785-
[99]: https://docs.oracle.com/en/database/oracle/oracle-database/12.2/adfns/cqn.html#GUID-373BAF72-3E63-42FE-8BEA-8A2AEFBF1C35
8794+
[99]: https://docs.oracle.com/en/database/oracle/oracle-database/18/adfns/cqn.html#GUID-373BAF72-3E63-42FE-8BEA-8A2AEFBF1C35

0 commit comments

Comments
 (0)