Lesson 6: Synchronizing

This lesson assumes you have completed all preceding lessons. See Lesson 1: Designing the schemas.

In this lesson, you synchronize the MobiLink client with the MobiLink server using the ulsync utility to initiate synchronization.

 Start the synchronization client
  1. Run the following command to synchronize the sync_mlsqla_remote database:

    ulsync -c "DBF=c:\mlsqla\mlsqla_project\sync_mlsqla\remote\sync_mlsqla_remote.udb" "Publications=sync_mlsqla_publication;MobiLinkUid=mlsqla_remote;MobiLinkPwd=mlsqla_pass;ScriptVersion=sync_mlsqla_scriptversion;Stream=tcpip{port=2439}"
    • DBF   indicates which database file you want to load and connect to when starting a database that is not running.

    • Publications   is the publication on the remote device that is used to perform the synchronization. (This publication was created by the Create Synchronization Model Wizard.)

    • MobiLinkUid   is the user name used to authenticate with the MobiLink server.

    • MobiLinkPwd   is the password used to authenticate with the MobiLink server.

    • ScriptVersion   is the script version on the remote device that is used to perform the synchronization. (This publication was created by the Create Synchronization Model Wizard.)

    • Stream   sets options to configure the network protocol.

    The progress of the synchronization appears in the MobiLink server messages window. When this command runs successfully, the ulsync application populates the remote database with a subset of information from the consolidated database.

    If synchronization fails, check the connection information you passed to the ulsync application, and the MobiLink user name and password. Failing that, check the publication name you used, and ensure that the consolidated database and MobiLink server are running. You can also examine the contents of the synchronization logs (server and client).

    Note

    If you are running the ulsync application on a different computer from your MobiLink server, you must pass in arguments that specify the location of the MobiLink server.

    After successfully synchronizing the remote client to the consolidated database through the MobiLink server, the remote database should be populated with information relevant to one region. You can verify that the database is populated in Sybase Central using the SQL Anywhere 12 plug-in.

  2. Open Sybase Central.

  3. Connect to the remote database:

    1. In the left pane, right-click UltraLite 12, and click Connect.

    2. Type DBA as the User ID and sql as the Password.

    3. In the Database File field, type C:\mlsqla\mlsqla_project\sync_mlsqla\remote\sync_mlsqla_remote.udb.

    4. Click Connect.

  4. In the left pane, expand UltraLite 12, sync_mlsqla_remote, Tables, Customers.

  5. Click the Data tab in the right pane.

    In the Customers tables, all the records are for the customers pertaining to the Eastern region. This particular region is not concerned with the customer information of other regions. For this reason, you set the synchronization scripts to filter out rows by region, and you set this database's remote ID to the value of a particular region identifier. This particular region's database takes up less space, and requires less time to synchronize. Since the remote database size is kept to a minimum, frequently-performed operations such as entering a new customer or processing a change in a mobile device run faster and more efficiently.

  6. Proceed to Cleaning up.

 See also