Use this stored procedure to add custom actions after dbmlsync has verified receipt of the upload by the MobiLink server.
Name | Value | Description |
---|---|---|
failure cause (in) |
See range of values in the Remarks section. |
The cause of failure of an upload. For more information, see Remarks. |
upload status (in) |
retry | committed | failed | unknown |
Specifies the status returned by the MobiLink server when dbmlsync attempted to verify receipt of the upload. retry - The MobiLink server and dbmlsync had different values for the log offset from which the upload should start. The upload was not committed by the MobiLink server. The dbmlsync utility attempts to send another upload starting from a new log offset. committed - The upload was received by the MobiLink server and committed. failed - The MobiLink server did not commit the upload. unknown - The upload was not acknowledged by the MobiLink server. There is no way to know if it was committed or not. |
publication_n (in) |
publication |
Deprecated. Use subscription_n instead. The publications being synchronized, where n is an integer. There is one publication_n entry for each publication being synchronized. The numbering of n starts at zero. |
MobiLink user (in) |
MobiLink user name |
The MobiLink user for which you are synchronizing. |
script version (in) |
script version name |
The MobiLink script version to be used for the synchronization. |
authentication value (in) | value |
This value indicates the results of dbmlsync's attempt to authenticate to the MobiLink server. It is generated by the authenticate_user, authenticate_user_hashed, or authenticate_parameters script on the server. The value is an empty string when the upload status is unknown or when the upload_end hook is called after an upload is re-sent because of a conflict between the log offsets stored in the remote and consolidated databases. |
subscription_n (in) | subscription name(s) | The names of subscriptions being synchronized where n is an integer. This is one subscription_n entry for each subscription being synchronized. The numbering of n starts at zero. |
If a procedure of this name exists, it is called immediately after dbmlsync has sent the upload and received confirmation of it from the MobiLink server.
When performing a transactional upload or an incremental upload this hook is called after each segment of the upload is sent. In these cases, the upload status will be "unknown" each time the hook is called except for the last time.
Actions of this procedure are committed immediately after execution.
The range of possible parameter values for the failure cause row in the #hook_dict table includes:
UPLD_ERR_INVALID_USERID_OR_PASSWORD The user ID or password was incorrect.
UPLD_ERR_USERID_OR_PASSWORD_EXPIRED The user ID or password expired.
UPLD_ERR_REMOTE_ID_ALREADY_IN_USE The remote ID was already in use.
UPLD_ERR_SQLCODE_n Here, n is an integer. A SQL error occurred in the consolidated database. The integer specified is the SQLCODE for the error encountered.
UPLD_ERR_USER_ABORT_REQUEST The upload was aborted at the user's request.
Assume you use the following table to log synchronization events on the remote database.
CREATE TABLE SyncLog ( "event_id" integer NOT NULL DEFAULT autoincrement , "event_time" timestamp NULL, "event_name" varchar(128) NOT NULL , "subs" varchar(1024) NULL , PRIMARY KEY ("event_id") ) |
The following logs the end up the upload for each synchronization.
CREATE PROCEDURE sp_hook_dbmlsync_upload_end () BEGIN DECLARE subs_list VARCHAR(1024); -- build a list of subscriptions being synchronized SELECT LIST(value) INTO subs_list FROM #hook_dict WHERE name LIKE 'subscription_%'; -- log the event INSERT INTO SyncLog(event_time, event_name, subs) VALUES( CURRENT TIMESTAMP, 'sp_hook_dbmlsync_upload_end', subs_list ); END |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |