Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
抛出此异常说明出现了使当前同步无法完成的错误状况。
public class SynchronizationException
SynchronizationException 类的所有成员,包括所有继承的成员。
SynchronizationException 构造函数
抛出此异常将强制 MobiLink 服务器回退当前同步并重新初始化连接。
以下示例演示如何在发生问题时抛出 [SynchronizationException],从而致使 MobiLink 服务器回退。
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"); } } }