Skip to content

Commit

Permalink
0003176: SymDS V3.7 and V3.8 for "sym_context" With INTERBASE
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwellpettit committed Jul 14, 2017
1 parent 34383ac commit 061dac2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Expand Up @@ -40,7 +40,7 @@
*/
public class InterbaseSymmetricDialect extends AbstractSymmetricDialect implements ISymmetricDialect {

public static final String CONTEXT_TABLE_NAME = "context";
public static final String CONTEXT_TABLE_NAME = "temp_context";

static final String CONTEXT_TABLE_CREATE = "create global temporary table %s (name varchar(30), context_value varchar(30)) on commit preserve rows";

Expand Down
Expand Up @@ -48,11 +48,11 @@ public InterbaseTriggerTemplate(ISymmetricDialect symmetricDialect) {
" declare variable sync_triggers_disabled varchar(30); " +
" declare variable sync_node_disabled varchar(30); " +
" begin " +
" select context_value from $(prefixName)_context where name = 'sync_triggers_disabled' into :sync_triggers_disabled; " +
" select context_value from $(prefixName)_" + InterbaseSymmetricDialect.CONTEXT_TABLE_NAME + " where name = 'sync_triggers_disabled' into :sync_triggers_disabled; " +
" $(custom_before_insert_text) \n" +
" if ($(syncOnInsertCondition) and $(syncOnIncomingBatchCondition)) then " +
" begin " +
" select context_value from $(prefixName)_context where name = 'sync_node_disabled' into :sync_node_disabled; " +
" select context_value from $(prefixName)_" + InterbaseSymmetricDialect.CONTEXT_TABLE_NAME + " where name = 'sync_node_disabled' into :sync_node_disabled; " +
" select gen_id($(defaultSchema)GEN_$(prefixName)_data_data_id, 1) from rdb$database into :name; " +
" insert into $(defaultSchema)$(prefixName)_data " +
" (data_id, table_name, event_type, trigger_hist_id, row_data, channel_id, transaction_id, source_node_id, external_data, create_time) " +
Expand All @@ -77,11 +77,11 @@ public InterbaseTriggerTemplate(ISymmetricDialect symmetricDialect) {
" declare variable sync_triggers_disabled varchar(30); " +
" declare variable sync_node_disabled varchar(30); " +
" begin " +
" select context_value from $(prefixName)_context where name = 'sync_triggers_disabled' into :sync_triggers_disabled; " +
" select context_value from $(prefixName)_" + InterbaseSymmetricDialect.CONTEXT_TABLE_NAME + " where name = 'sync_triggers_disabled' into :sync_triggers_disabled; " +
" $(custom_before_insert_text) \n" +
" if ($(syncOnInsertCondition) and $(syncOnIncomingBatchCondition)) then " +
" begin " +
" select context_value from $(prefixName)_context where name = 'sync_node_disabled' into :sync_node_disabled; " +
" select context_value from $(prefixName)_" + InterbaseSymmetricDialect.CONTEXT_TABLE_NAME + " where name = 'sync_node_disabled' into :sync_node_disabled; " +
" select gen_id($(defaultSchema)GEN_$(prefixName)_data_data_id, 1) from rdb$database into :name; " +
" insert into $(defaultSchema)$(prefixName)_data " +
" (data_id, table_name, event_type, trigger_hist_id, pk_data, channel_id, transaction_id, source_node_id, external_data, create_time) " +
Expand All @@ -108,11 +108,11 @@ public InterbaseTriggerTemplate(ISymmetricDialect symmetricDialect) {
" declare variable sync_triggers_disabled varchar(30); " +
" declare variable sync_node_disabled varchar(30); " +
" begin " +
" select context_value from $(prefixName)_context where name = 'sync_triggers_disabled' into :sync_triggers_disabled; " +
" select context_value from $(prefixName)_" + InterbaseSymmetricDialect.CONTEXT_TABLE_NAME + " where name = 'sync_triggers_disabled' into :sync_triggers_disabled; " +
" $(custom_before_update_text) \n" +
" if ($(syncOnUpdateCondition) and $(syncOnIncomingBatchCondition)) then " +
" begin " +
" select context_value from $(prefixName)_context where name = 'sync_node_disabled' into :sync_node_disabled; " +
" select context_value from $(prefixName)_" + InterbaseSymmetricDialect.CONTEXT_TABLE_NAME + " where name = 'sync_node_disabled' into :sync_node_disabled; " +
" select gen_id($(defaultSchema)GEN_$(prefixName)_data_data_id, 1) from rdb$database into :name; " +
" insert into $(defaultSchema)$(prefixName)_data " +
" (data_id, table_name, event_type, trigger_hist_id, pk_data, row_data, old_data, channel_id, transaction_id, source_node_id, external_data, create_time) " +
Expand Down Expand Up @@ -140,11 +140,11 @@ public InterbaseTriggerTemplate(ISymmetricDialect symmetricDialect) {
" declare variable sync_triggers_disabled varchar(30); " +
" declare variable sync_node_disabled varchar(30); " +
" begin " +
" select context_value from $(prefixName)_context where name = 'sync_triggers_disabled' into :sync_triggers_disabled; " +
" select context_value from $(prefixName)_" + InterbaseSymmetricDialect.CONTEXT_TABLE_NAME + " where name = 'sync_triggers_disabled' into :sync_triggers_disabled; " +
" $(custom_before_update_text) \n" +
" if ($(syncOnUpdateCondition) and $(syncOnIncomingBatchCondition)) then " +
" begin " +
" select context_value from $(prefixName)_context where name = 'sync_node_disabled' into :sync_node_disabled; " +
" select context_value from $(prefixName)_" + InterbaseSymmetricDialect.CONTEXT_TABLE_NAME + " where name = 'sync_node_disabled' into :sync_node_disabled; " +
" select gen_id($(defaultSchema)GEN_$(prefixName)_data_data_id, 1) from rdb$database into :name; " +
" insert into $(defaultSchema)$(prefixName)_data " +
" (data_id, table_name, event_type, trigger_hist_id, pk_data, channel_id, transaction_id, source_node_id, external_data, create_time) " +
Expand All @@ -170,11 +170,11 @@ public InterbaseTriggerTemplate(ISymmetricDialect symmetricDialect) {
" declare variable sync_triggers_disabled varchar(30); " +
" declare variable sync_node_disabled varchar(30); " +
" begin " +
" select context_value from $(prefixName)_context where name = 'sync_triggers_disabled' into :sync_triggers_disabled; " +
" select context_value from $(prefixName)_" + InterbaseSymmetricDialect.CONTEXT_TABLE_NAME + " where name = 'sync_triggers_disabled' into :sync_triggers_disabled; " +
" $(custom_before_delete_text) \n" +
" if ($(syncOnDeleteCondition) and $(syncOnIncomingBatchCondition)) then " +
" begin " +
" select context_value from $(prefixName)_context where name = 'sync_node_disabled' into :sync_node_disabled; " +
" select context_value from $(prefixName)_" + InterbaseSymmetricDialect.CONTEXT_TABLE_NAME + " where name = 'sync_node_disabled' into :sync_node_disabled; " +
" select gen_id($(defaultSchema)GEN_$(prefixName)_data_data_id, 1) from rdb$database into :name; " +
" insert into $(defaultSchema)$(prefixName)_data " +
" (data_id, table_name, event_type, trigger_hist_id, pk_data, old_data, channel_id, transaction_id, source_node_id, external_data, create_time) " +
Expand Down

0 comments on commit 061dac2

Please sign in to comment.