MobiLink Synchronization Reference
Synchronization Events
Processes any statements at the time an application connects to the MobiLink synchronization server in preparation for the synchronization process.
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.
Item | Parameter | Description |
---|---|---|
1 | ml_username | VARCHAR(128) |
None.
The MobiLink synchronization server executes this event immediately after an application preparing to synchronize has formed a connection with the MobiLink synchronization server.
This event is executed within a separate transaction before the upload transaction. It is useful for maintaining statistics.
end_synchronization connection event
begin_synchronization table event
You may want to store the ml_username value in a temporary table or variable if you will be referencing that value many times in subsequent scripts.
Call ml_add_connection_script ( 'version1', 'begin_synchronization', 'set @EmployeeID = ?' );
The following stored procedure call registers a Java method called beginSynchronizationConnection as the script for the begin_synchronization connection event when synchronizing the script version ver1. This syntax is for Adaptive Server Anywhere consolidated databases.
call ml_add_java_connection_script( 'ver1', 'begin_synchronization', 'ExamplePackage.ExampleClass.beginSynchronizationConnection' )
Following is the sample Java method beginSynchronizationConnection. It saves the name of the synchronizing user for later use.
public String beginSynchronizationConnection( String user ) { _curUser = user; return( null ); }
The following stored procedure call registers a .NET method called BeginSync as the script for the begin_synchronization 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_synchronization', 'TestScripts.Test.BeginSync' )
Following is the C# signature for the call BeginSync.
public void BeginSync( string user )