Contents Index end_publication connection event end_synchronization table event

MobiLink Synchronization Reference
  Synchronization Events

end_synchronization connection event


Function 

Processes any statements 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.

Item Parameter Description
1 ml_username VARCHAR(128)
2 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 synchronization is complete and, if expecting a download acknowledgement, the MobiLink client has returned confirmation of receipt of the download stream.

This script is executed within a separate transaction after the download transaction. It is useful for maintaining statistics.

See also 

begin_synchronization connection event

begin_synchronization table event

end_synchronization table event

SQL example 

The following Adaptive Server Anywhere SQL script calls a stored procedure that records the end time of the synchronization attempt along with its success or failure status:

call ml_add_connection_script(
 'ver1',
 'end_synchronization',
 'call RecordEndOfSyncAttempt(?,?)' )
Java example 

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

call ml_add_java_connection_script(
  'ver1',
  'end_synchronization',
  'ExamplePackage.ExampleClass.endSynchronizationConnection'
)

Following is the content of the sample Java method endSynchronizationConnection. It uses the JDBC connection to execute an update.

public String endSynchronizationConnection(
 String user )
  throws java.sql.SQLException
{  execUpdate( _syncConn, "UPDATE sync_count set cnt =
   count + 1 where user_id = '" + user + "' " );
   return( null ); }
.NET example 

The following stored procedure call registers a .NET method called EndSync as the script for the end_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',
  'end_synchronization',
  'TestScripts.Test.EndSync'
)

Following is the C# signature for the call EndSync.

public void EndSync( string user )

Contents Index end_publication connection event end_synchronization table event