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:
Prepare a ul_synch_info structure.
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 ); } |
Call db_fini.
See Maintaining state in UltraLite Palm applications (deprecated) 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.
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:
Supply the required information in the stream_parms member of ul_synch_info passed to ULSetSynchInfo.
For a list of available values, see Network protocol options for UltraLite synchronization streams.
Supply a null value for the stream_parms member. The MobiLink conduit then searches in the ClientParms registry entry on the computer where it is running for information on how to connect to the MobiLink server.
The stream and stream parameters in the registry entry are specified in the same format as in the ul_synch_info structure stream_parms field.
See UltraLite synchronization parameters and network protocol options.
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |