Synchronization Parameter Behavior

These examples illustrate how a device application client uses a single synchronization parameter defined in Unwired WorkSpace to synchronize data on the client with data contained in the MBO instance on Unwired Server.

  1. Create a Customer MBO from the customer table in the sampledb.
  2. Add a stateParam synchronization parameter and map it to the state attribute.
  3. Deploy the MBO.



Example device application behavior using this synchronization parameter includes:
  1. Retrieve the synchronization parameters object from the MBO instance:
    CustomerSynchronizationParameters sp = 
    Customer.SynchronizationParameters;
  2. Set the stateParam synchronization parameter to "CA", save then synchronize. FindAll retrieves all 10 records that have state="CA".
    sp.stateParam = "CA";
    sp.Save();
    sp.Synchronize();
  3. Perform a second sync without setting stateParam. FindAll again returns the same 10 records.
    sp.Synchronize();

    Conclusion: You need not always set the sync parameter before a sync. If the same sync parameter value is to be used, it does not need to be set again, since it uses the previous sync parameter value.

  4. Set stateParam to "NY", save then synchronize. FindAll retrieves 23 records, the 10 returned using the previous sync parameter state="CA" and 13 where state="NY".
    sp.stateParam = "NY";
    sp.Save();
    sp.Synchronize();

    Conclusion: When you save a new set of sync parameters the records returned from the synchronization includes all previous sync sets. That is, synchronization parameters are cumulative and previous sync parameters are maintained unless Delete is called on the sync parameters.

  5. Call the Delete method, set stateParam to "MN", and save then synchronize. FindAll returns 5 records where state="MN".
    sp.Delete();
    //You must re-retrieve the synchronization parameter instance
    sp = Customer.SynchronizationParameters;
    sp.stateParam = "MN";
    sp.Save();
    sp.Synchronize();

    Conclusion: Calling Delete on the sync parameter clears the previous sync parameters. On the next sync the previous result sets for those sync parameters are removed.

It is not possible to retrieve all the synchronization parameter values except for those most recently used. When a synchronization is performed it synchronizes all sync parameter sets. That is, it attempts to load data from the Unwired Server cache based on each sync parameter (for on demand this is done during the sync, for scheduled it is based on the configured schedule).