Contents Index synchronization_statistics connection event time_statistics connection event

MobiLink Synchronization Reference
  Synchronization Events

synchronization_statistics table event


Function 

Tracks synchronization statistics.

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 warnings INTEGER
4 errors INTEGER
Default action 

None.

Description 

The synchronization_statistics event allows you to gather, for any user and table, the number of warnings and errors that occurred during synchronization. The synchronization_statistics table script is called just prior to the commit at the end of the end synchronization transaction.

See also 

download_statistics connection event

download_statistics table event

upload_statistics connection event

upload_statistics table event

synchronization_statistics connection event

time_statistics connection event

time_statistics table event

MobiLink Monitor

SQL example 

The following example comes from an Oracle installation.

INSERT INTO sync_tab_audit (id, ml_user, table,
warnings, errors) VALUES (s_audit.nextval,?,?,?,?)

Once synchronization statistics are inserted into the audit table, you may use these statistics to monitor your synchronizations and make optimizations where applicable.

Java example 

The following stored procedure call registers a Java method called synchronizationStatisticsTable as the script for the synchronization_statistics 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',
  'synchronization_statistics',
  'ExamplePackage.ExampleClass.synchronizationStatisticsTable'
)

Following is the sample Java method synchronizationStatisticsTable. It logs some of the statistics to the MobiLink output log. (This might be useful at development time but would slow down a production server.)

public String synchronizationStatisticsTable(
String user, String table, int warnings, int errors )
{  java.lang.System.out.println( "synch statistics for
   table: " + table + " errors: " + errors );
   return( null ); }
.NET example 

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

Following is the C# signature for the call SyncTableStats.

public void SyncTableStats(
  string user,
  string table,
  int warnings,
  int errors )

Contents Index synchronization_statistics connection event time_statistics connection event