Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.0 » MobiLink - Server Administration » MobiLink Server APIs » Writing synchronization scripts in Java » MobiLink server API for Java Reference

 

SynchronizationException class

Syntax
public ianywhere.ml.script.SynchronizationException
Remarks

Thrown to indicate that there is an error condition that makes the completion of the current synchronization impossible. Throwing this exception forces the MobiLink server to rollback.

Members

All members of ianywhere.ml.script.SynchronizationException, including all inherited members.

Example

The following code is a function that can throw a SynchronizationException if a problem occurs, which causes the MobiLink server to rollback.

public void handleUpload( UploadData ud )
  throws SQLException, IOException, SynchronizationException {
  UploadedTableData tables[] = ud.getUploadedTables();
  for( int i = 0; i < tables.length; i++ ) {
    UploadedTableData currentTable = tables[i];
    println( "table " + java.lang.Integer.toString( i ) +
     " name: " + currentTable.getName() );
    // Print out delete result set.
    println( "Deletes" );
    printRSInfo( currentTable.getDeletes() );

    // Print out insert result set.
    println( "Inserts" );
    printRSInfo( currentTable.getInserts() );

    // print out update result set
    println( "Updates" );
    printUpdateRSInfo( currentTable.getUpdates() );

    if( /* Reason for Sync failure */ ) {
      throw new SynchronizationException( "Sync Failed" );
    }

  }
  }

SynchronizationException constructors