Use this stored procedure to add custom actions immediately before synchronization is complete.
Name |
Value |
Description |
---|---|---|
restart (out) |
sync | download | none |
If set to sync, then dbmlsync retries the synchronization it just completed. The value sync replaces true, which is identical but is deprecated. If set to none (the default), then dbmlsync shuts down or restarts according to its command line arguments. The value none replaces false, which is identical but is deprecated. If set to download and the restartable download parameter is true, then dbmlsync attempts to restart the download that just failed. |
exit code (in) |
number |
If set to anything other than zero (the default), this represents a synchronization error. |
publication_n (in) |
publication |
The publications being synchronized, where n is an integer. There is one publication_n entry for each publication being uploaded. The numbering of n starts at zero. |
MobiLink user (in) |
MobiLink user name |
The MobiLink user for which you are synchronizing. |
upload status (in) |
not sent | committed | failed |
Specifies the status returned by the MobiLink server when dbmlsync attempted to verify receipt of the upload. The status can be:
|
script version (in) |
script version name |
The MobiLink script version to be used for the synchronization. |
restartable download (in) | true|false |
If true, the download for the current synchronization failed and can be restarted. If false, the download was successful or it cannot be restarted. |
restartable download size (in) | integer |
When the restartable download parameter is true, this parameter indicates the number of bytes that were received before the download failed. When restartable download is false, this value is meaningless. |
error hook user state (in) | integer |
This value contains information about errors and can be sent from the hooks sp_hook_dbmlsync_all_error, sp_hook_dbmlsync_communication_error, sp_hook_dbmlsync_misc_error, or sp_hook_dbmlsync_sql_error. |
If a procedure of this name exists, it is called at the end of each synchronization.
Actions of this procedure are committed immediately after execution.
If an sp_hook_dbmlsync_end hook is defined so that the hook always sets the restart parameter to sync, and you specify multiple publications on the dbmlsync command line in the form -n pub1, -n pub2, and so on, then dbmlsync repeatedly synchronizes the first publication and never synchronizes the second.
In the following example the download is manually restarted if the download for the current synchronization failed and can be restarted.
CREATE PROCEDURE sp_hook_dbmlsync_end() BEGIN -- Restart the download if the download for the current sync -- failed and can be restarted IF EXISTS (SELECT * FROM #hook_dict WHERE name = 'restartable download' AND value='true') THEN UPDATE #hook_dict SET value ='download' WHERE name='restart'; END IF; END; |
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |