Most Popular
Recently Added
Recently Updated

Disabling Sync Triggers for Session

On most database platforms, SymmetricDS uses session variables to prevent its triggers from capturing data while it synchronizes and saves incoming data. If you need to modify data without triggers capturing data, you can use the same session variables. Find your database in the sections below for specific instructions. Note that if you have enabled the "sync on incoming" feature in your configuration, the triggers will capture data regardless of the session variables.

Oracle

Disable the sync triggers:

call sym_pkg.setValue(1);

Enable the sync triggers:

call sym_pkg.setValue(0);

Check whether sync triggers are disabled or not:

select sym_trigger_disabled() is null from dual;

SQL Server 2016 and newer

Disable the sync triggers:

EXEC sp_set_session_context '@sync_triggers_disabled', 1;

Enable the sync triggers:

EXEC sp_set_session_context '@sync_triggers_disabled', NULL;

Check whether sync triggers are disabled or not:

select dbo.sym_triggers_disabled() = 0;

SQL Server 2014 and older

Disable the sync triggers:

DECLARE @CI VarBinary(128);
SET @CI=cast ('1' as varbinary(128));
SET context_info @CI;

Enable the sync triggers:

SET context_info 0x0;

Check whether sync triggers are disabled or not:

select dbo.sym_triggers_disabled() = 0;

MySQL

Disable the sync triggers:

set @sync_triggers_disabled = 1;

Enable the sync triggers:

set @sync_triggers_disabled = null;

Check whether sync triggers are disabled or not:

select @sync_triggers_disabled is null;

PostgreSQL

Disable the sync triggers:

select set_config('symmetric.triggers_disabled', '1', false);

Enable the sync triggers:

select set_config('symmetric.triggers_disabled', '', false);

Check whether sync triggers are disabled or not:

select sym_triggers_disabled() = 0;

Sybase ASE

Disable the sync triggers:

set clientapplname 'SymmetricDS'

Enable the sync triggers:

set clientapplname ''

SQL Anywhere/Sybase ASA

Disable the sync triggers:

create variable sync_triggers_disabled DEFAULT 1

Enable the sync triggers:

drop variable sync_triggers_disabled

Properties ID: 000023   Views: 5502   Updated: 2 years ago
Filed under: