3.1.5.2.9 Receiving a CPMGetNotify Request

If the server SHOULD receive a CPMGetNotify message from a client, the server MUST do the following:

  1. Check whether the client has a query associated with it. If this is not the case, the server MUST report a STATUS_INVALID_PARAMETER (0xC000000D) error.

  2. If there were no changes in the query result set since the last CPMSendNotifyOut message for this client, or if the query is not currently monitored for changes in the results set, the server MUST respond with a CPMGetNotify message and start to monitor the query for changes in the results set. If at a later time there is a change in the query results set, the server MUST send exactly one CPMSendNotifyOut message to the client and MUST specify the change in the _watchNotify field.

  3. If there were changes to the query result set since the last CPMSendNotifyOut message, the server MUST reply with CPMSendNotifyOut and MUST specify the change in the _watchNotify field. Note, that in the case of many changes to the query results, DBWATCHNOTIFY_ROWSCHANGED takes priority (that is, if the query was done and re-executed, and then if the number of rows changed and the query was done again, then the event reported would be DBWATCHNOTIFY_ROWSCHANGED).