Navigation Menu

Skip to content

Commit

Permalink
Merge branch '3.9' of https://github.com/JumpMind/symmetric-ds.git in…
Browse files Browse the repository at this point in the history
…to 3.9
  • Loading branch information
jumpmind-josh committed Mar 1, 2018
2 parents d7dfee0 + 5e35ff5 commit 774a4f9
Showing 1 changed file with 13 additions and 0 deletions.
Expand Up @@ -49,6 +49,7 @@
import org.jumpmind.db.util.BasicDataSourcePropertyConstants;
import org.jumpmind.exception.IoException;
import org.jumpmind.symmetric.ISymmetricEngine;
import org.jumpmind.symmetric.SymmetricException;
import org.jumpmind.symmetric.common.Constants;
import org.jumpmind.symmetric.common.ParameterConstants;
import org.jumpmind.symmetric.io.data.writer.StructureDataWriter.PayloadType;
Expand Down Expand Up @@ -1343,6 +1344,8 @@ private void syncTriggersImpl(ISymmetricEngine engine, boolean force) {
ITriggerRouterService triggerRouterService = engine.getTriggerRouterService();
StringBuilder buffer = new StringBuilder();
triggerRouterService.syncTriggers(buffer, force);

assertTriggerCreation(triggerRouterService, null);
}

private void syncTriggersByTableImpl(ISymmetricEngine engine, String catalogName,
Expand All @@ -1354,7 +1357,17 @@ private void syncTriggersByTableImpl(ISymmetricEngine engine, String catalogName
if (table == null) {
throw new NotFoundException();
}

triggerRouterService.syncTriggers(table, force);
assertTriggerCreation(triggerRouterService, table);
}

private void assertTriggerCreation(ITriggerRouterService triggerRouterService, Table table){
for(Map.Entry<Trigger, Exception> failedTriggers : triggerRouterService.getFailedTriggers().entrySet()){
if(table == null || failedTriggers.getKey().getFullyQualifiedSourceTableName().equalsIgnoreCase(table.getFullyQualifiedTableName())){
throw new SymmetricException("Trigger creation failed", failedTriggers.getValue());
}
}
}

private void dropTriggersImpl(ISymmetricEngine engine) {
Expand Down

0 comments on commit 774a4f9

Please sign in to comment.