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

SAP Sybase SQL Anywhere 16.0 » Mobile Link サーバ管理 » Mobile Link サーバテクノロジ » リモートデータベースの集中管理 » リモートタスク

 

リモートタスクのロジック

次に、リモートタスクの実行に使用されるロジックの概要を示します。



current_command = 1;
num_tries = 0;
EXECUTE_TASK:
loop {
      num_tries = num_tries + 1;
      EXECUTE_COMMANDS;
      if( task_success or task_abort ) break EXECUTE_TASK;
      if( task_retry and at maximum tries ) {
            break EXECUTE_TASK;
      } else {
            continue;
      }
}

EXECUTE_COMMANDS:
for each command starting at current_command {
      execute current_command;
      if( command failed ) {
            if( action on failure is "abort task" ) {
                  break EXECUTE_COMMANDS, returning task_abort;
            } else if( action on failure is "continue" ) {
                  // no action, continue at next command
            } else if( action on failure is "retry task" ) {
                  current_command = 1;
                  break EXECUTE_COMMANDS, returning task_retry;
            } else if( action on failure is "retry command" ) {
                  // no change to current_command
                  break EXECUTE_COMMANDS, returning task_retry;
            }
      }
      current_command = next command number;
}
return task_success;

最大実行時間は、タスクが開始されたときと、コマンドが失敗したためにコマンドまたはタスク全体を再試行したときにリセットされます。

コマンドが失敗したためにコマンドまたはタスク全体を再試行した場合、条件は再評価されず、新しいトリガも必要ありません。条件で参照されるプロパティがタスクの実行中に変化する可能性があるかどうか、条件が満たされずにコマンドを再試行した場合に望ましくない結果が発生するかどうかを考慮することが重要です。