Use this stored procedure to add custom actions immediately before the transaction log is scanned for upload.
Name | Value | Description |
---|---|---|
starting log offset_n (in) |
number |
The progress value for each subscription being synchronized. The progress value is the offset in the transaction log up to which all data for the subscription has been uploaded. There is one value for each subscription being synchronized. The numbering of n starts at zero. This value matches subscription_n. For example, log offset_0 is the offset for subscription_0. |
log scan retry (in) |
true | false |
If this is the first time the transaction log has been scanned for this synchronization, the value is false; otherwise it is true. The log is scanned twice when the MobiLink server and dbmlsync have different information about where the scanning should begin. |
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. |
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 before dbmlsync scans the transaction log to assemble the upload.
This hook is ideal for making any last minute changes to the tables being synchronized that you want to include in the upload.
Actions of this procedure are committed immediately after execution.
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 beginning of the log scan for each synchronization.
CREATE PROCEDURE sp_hook_dbmlsync_logscan_begin () 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_logscan_begin', subs_list ); END |
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |