MobiLink Synchronization Reference
Synchronization Events
Processes any statements just before the MobiLink synchronization server commences preparing the download data stream.
In the following table, the description provides the SQL data type. If you are writing your script in Java or .NET, you should use the appropriate corresponding data type. See SQL-Java data types and SQL-.NET data types.
Event parameters are optional only if no subsequent parameters are specified. You must use parameter 1 if you want to use parameter 2.
Item | Parameter | Description |
---|---|---|
1 | last_download | TIMESTAMP |
2 | ml_username | VARCHAR(128) |
None.
The MobiLink synchronization server executes this event as the first step in the processing of downloaded information. Download information is processed in a single transaction. The execution of this event is the first action in this transaction.
The last_download timestamp is the value obtained from the consolidated database during the last successful synchronization immediately prior to the download phase. If the current user has never synchronized successfully, this value is set to 1900-01-01.
The following example works in an Adaptive Server Anywhere installation.
call ml_add_connection_script ( 'Lab', 'begin_download', 'CALL SetDownloadParameters ( ?, ? )' )
The following stored procedure call registers a Java method called beginDownloadConnection as the script for the begin_download connection event when synchronizing the script version ver1. This syntax is for Adaptive Server Anywhere consolidated databases.
call ml_add_java_connection_script( 'example_ver', 'begin_download', 'ExamplePackage.ExampleClass.beginDownloadConnection' )
Following is the sample Java method beginDownloadConnection. It calls a Java function that will prepare the delete tables using a JDBC synchronization that was set earlier.
public String beginDownloadConnection( Timestamp ts, String user ) throws java.sql.SQLException { prepDeleteTables ( _syncConn, ts, user ); return ( null ); }
The following stored procedure call registers a .NET method called BeginDownload as the script for the begin_download connection event when synchronizing the script version ver1. This syntax is for Adaptive Server Anywhere consolidated databases.
call ml_add_dnet_connection_script( 'ver1', 'begin_download', 'TestScripts.Test.BeginDownload' )
Following is the C# signature for the call BeginDownload.
public void BeginDownload( DateTime timestamp, string user )