The following pseudocode provides an overview of the sequence in which download events, and hence the script of the same name, are invoked.
These events take place at the download location in the complete event model provided in Overview of MobiLink events.
------------------------------------------------------ prepare_for_download ------------------------------------------------------ modify_last_download_timestamp prepare_for_download if( modify_last_download_timestamp script is defined or prepare_for_download script is defined ) { COMMIT } ------------------------------------------------------ download ------------------------------------------------------ begin_download // Connection event. for each table being synchronized { begin_download // Table event. } handle_DownloadData for each table being synchronized { begin_download_deletes for each row in download_delete_cursor { if( all primary key columns are NULL ) { send TRUNCATE to remote } else { send DELETE to remote } } end_download_deletes begin_download_rows for each row in download_cursor { send INSERT ON EXISTING UPDATE to remote } end_download_rows } modify_next_last_download_timestamp for each table being synchronized { if( begin_download table script is called ) { end_download // Table event } } if( begin_download connect script is called ) { end_download // Connection event } for each table being synchronized { download_statistics // Table event. } download_statistics // Connection event. COMMIT |
For SQL Anywhere remotes, see SendDownloadACK (sa) extended option. For UltraLite remotes, see Send Download Acknowledgement synchronization parameter.
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |