Contents Index sp_hook_dbmlsync_begin sp_hook_dbmlsync_download_begin

MobiLink Synchronization Reference
  Stored Procedures
    Client event-hook procedures

sp_hook_dbmlsync_delay


Function 

Use this stored procedure to control when synchronization takes place.

Rows in #hook_dict table  
Name Values Description
delay duration (in|out) number of seconds If the procedure sets the delay duration value to zero, then dbmlsync synchronization proceeds. A non-zero delay_duration value specifies the number of seconds before the delay hook is called again.
maximum accumulated delay (in|out) number of seconds The maximum accumulated delay specifies the maximum number of seconds delay before each synchronization. Dbmlsync keeps track of the total delay created by all calls to the delay hook since the last synchronization. If no synchronization has occurred since dbmlsync started running, the total delay is calculated from the time dbmlsync started up. When the total delay exceeds the value of maximum accumulated delay, synchronization begins without any further calls to the delay hook.
publication_n (in) publication name The publications being synchronized, where n is an integer. There is one publication_n entry for each publication being uploaded.
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.
Description 

If a procedure of this name exists, it is called before sp_hook_dbmlsync_begin at the beginning of the synchronization process.

Actions of this procedure are committed immediately after execution.

See also 

Synchronization event hook sequence

Example 

The following procedure delays synchronization during a scheduled maintenance hour between 19:00 and 20:00 each day.

create procedure sp_hook_dbmlsync_delay()
begin
  declare down_time_start time;
  declare is_down_time varchar(128);
  set down_time_start='19:00';
  if abs( datediff( minute,down_time_start,now(*) ) ) <
  60 then
    set is_down_time='10';
  else
    set is_down_time='0';
  end if;
  UPDATE #hook_dict
  SET value = is_down_time
  WHERE name = 'delay duration'
end

Contents Index sp_hook_dbmlsync_begin sp_hook_dbmlsync_download_begin