Lesson 7: Issue push requests

In this lesson, you make a change to the Dealer table in the consolidated database so that the information can be downloaded into the remote database when the Listener polls for push notifications. You then prompt a server-initiated synchronization by inserting a poll key value into the consolidated database. The Notifier runs the request_cursor event, detects the poll key in the non_sync_request table, then sends a push notification to the Listener. When the Listener receives the push notification, it synchronizes with the MobiLink database and updates the remote database.

To make a change in the consolidated database
  1. Connect to the SIS_CarDealer_LP_DBLSN_CONDB database through Interactive SQL.

  2. Type the following script:

    UPDATE Dealer
        SET RATING = 'B' WHERE name = 'Geo'; 
    COMMIT;

You issue push requests by populating the non_sync_request table directly. The poll key column determines which device should receive push notifications.

To prompt server-initiated synchronization
  1. Connect to the SIS_CarDealer_LP_DBLSN_CONDB database through Interactive SQL.

  2. Type the following script:

    INSERT INTO non_sync_request(poll_key) VALUES ('%remote_id%.no_action');
    COMMIT;
  3. Wait a few seconds for the synchronization to occur.

    The Listener should poll the consolidated database, download the push notification, then update the Dealer table on the remote database.

To stop server-initiated synchronization with a device, delete the poll key value from the non_sync_request table.

To stop server-initiated synchronization
  1. Connect to the SIS_CarDealer_LP_DBLSN_CONDB database through Interactive SQL.

  2. Type the following script:

    DELETE FROM non_sync_request WHERE poll_key = '%remote_id%.no_action';
    COMMIT;
See also