Skip to content

Commit

Permalink
0001239: Add the ability to NOT add triggers to a client database unt…
Browse files Browse the repository at this point in the history
…il initial load has finished
  • Loading branch information
chenson42 committed May 24, 2013
1 parent 4b8b2eb commit cf26719
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,15 @@ protected Set<String> getTriggerIdsFrom(List<Trigger> triggersThatShouldBeActive
}
return triggerIds;
}

protected Trigger getTriggerFromList(String triggerId, List<Trigger> triggersThatShouldBeActive) {
for (Trigger trigger : triggersThatShouldBeActive) {
if (trigger.getTriggerId().equals(triggerId)) {
return trigger;
}
}
return null;
}

protected void inactivateTriggers(List<Trigger> triggersThatShouldBeActive,
StringBuilder sqlBuffer) {
Expand All @@ -1015,7 +1024,7 @@ protected void inactivateTriggers(List<Trigger> triggersThatShouldBeActive,
for (TriggerHistory history : activeHistories) {
boolean removeTrigger = false;
Set<Table> tables = tablesByTriggerId.get(history.getTriggerId());
Trigger trigger = getTriggerForCurrentNodeById(history.getTriggerId());
Trigger trigger = getTriggerFromList(history.getTriggerId(), triggersThatShouldBeActive);
if (tables == null && trigger != null) {
tables = getTablesForTrigger(trigger, triggersThatShouldBeActive);
tablesByTriggerId.put(trigger.getTriggerId(), tables);
Expand Down

0 comments on commit cf26719

Please sign in to comment.