Adding HotSync synchronization to Palm applications

HotSync synchronization takes place when an UltraLite application is closed. It is initiated by the HotSync.

If you use HotSync, then you synchronize by calling ULSetSynchInfo before closing the application. Do not use ULSynchronize or ULConnection.Synchronize for HotSync synchronization.

To enable HotSync synchronization from your application you must add code for the following steps:

  1. Prepare a ul_synch_info structure.
  2. Call the ULSetSynchInfo function, supplying the ul_synch_info structure as an argument.

    This function is called when the user switches away from the UltraLite application. You must ensure that all outstanding operations are committed before calling db_fini. The ul_synch_info.stream parameter is ignored, and so does not need to be set.

    For example:

    //C++ API
    ul_synch_info info;
    ULInitSynchInfo( &info );
    info.stream_parms =
      UL_TEXT( "stream=tcpip;host=localhost" );
    info.user_name = UL_TEXT( "50" );
    info.version = UL_TEXT( "custdb" );
    
    ULSetSynchInfo( &sqlca, &info );
    
    if( !db.Close( ) ) {
      return( false );
    }
  3. Call db_fini.

See Maintaining state in UltraLite Palm applications and Synchronization parameters for UltraLite.

An UltraLite HotSync conduit is required for HotSync synchronization of UltraLite applications. If there are uncommitted transactions when you close your Palm application, and if you synchronize, the conduit reports that synchronization fails because of uncommitted changes in the database.

Specifying stream parameters

The synchronization stream parameters in the ul_synch_info structure control communication with the MobiLink server. For HotSync synchronization, the UltraLite application does not communicate directly with a MobiLink server; it is the HotSync conduit instead.

You can supply synchronization stream parameters to govern the behavior of the MobiLink conduit in one of the following ways:

See also