Contents Index end_synchronization connection event end_upload connection event

MobiLink Synchronization Reference
  Synchronization Events

end_synchronization table event


Function 

Processes statements related to a specific table at the time an application disconnects from the MobiLink synchronization server upon completion of the synchronization process.

Parameters 

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. For example, you must use parameter 1 if you want to use parameter 2.

Item Parameter Description
1 ml_username VARCHAR(128)
2 table VARCHAR(128)
3 sync_ok INTEGER. This value is 1 for a successful synchronization and 0 for an unsuccessful synchronization.
Default action 

None.

Description 

The MobiLink synchronization server executes this script after an application has synchronized and is about to disconnect from the MobiLink synchronization server, and before the connection level script of the same name.

You can have one end_synchronization script for each table in the remote database.

See also 

begin_synchronization table event

end_synchronization connection event

end_synchronization table event

SQL example 

The following Adaptive Server Anywhere SQL script drops a temporary table created by the begin_synchronization script:

call ml_add_table_script(
 'ver1',
 'sales_order',
 'end_synchronization',
 'drop table #sales_order' )
Java example 

The following stored procedure call registers a Java method called endSynchronizationTable as the script for the end_synchronization table event when synchronizing the script version ver1. This syntax is for Adaptive Server Anywhere consolidated databases.

call ml_add_java_table_script(
   'ver1',
   'table1',
   'end_synchronization',
   'ExamplePackage.ExampleClass.endSynchronizationTable' )

Following is the sample Java method endSynchronizationTable. It takes no action. MobiLink interprets NULL as no script.

public String endSynchronizationTable(  String user,
String table )
{  return( null ); }
.NET example 

The following stored procedure call registers a .NET method called EndTableSync as the script for the end_synchronization table event when synchronizing the script version ver1 and the table table1. This syntax is for Adaptive Server Anywhere consolidated databases.

call ml_add_dnet_table_script(
  'ver1', 'table1', 'end_synchronization',
  'TestScripts.Test.EndTableSync'
)

Following is the C# signature for the call EndTableSync.

public void EndTableSync( string user, string table )

Contents Index end_synchronization connection event end_upload connection event