Skip to content

Commit

Permalink
Uninstall not removing application specific triggers due to sql error…
Browse files Browse the repository at this point in the history
… while removing node group links.

1.  Remove conflicts before attempting to remove node group links.
2.  Don't swallow sql errors (log them, should determine whether we want to bubble up)
  • Loading branch information
gwilmer committed Dec 18, 2012
1 parent 21215d8 commit 41e9a27
Showing 1 changed file with 12 additions and 4 deletions.
Expand Up @@ -87,6 +87,7 @@
import org.jumpmind.symmetric.service.impl.ConfigurationService;
import org.jumpmind.symmetric.service.impl.DataExtractorService;
import org.jumpmind.symmetric.service.impl.DataLoaderService;
import org.jumpmind.symmetric.service.impl.DataLoaderService.ConflictNodeGroupLink;
import org.jumpmind.symmetric.service.impl.DataService;
import org.jumpmind.symmetric.service.impl.IncomingBatchService;
import org.jumpmind.symmetric.service.impl.LoadFilterService;
Expand Down Expand Up @@ -542,6 +543,12 @@ public synchronized void uninstall() {
for (TriggerRouter triggerRouter : triggerRouters) {
triggerRouterService.deleteTrigger(triggerRouter.getTrigger());
triggerRouterService.deleteRouter(triggerRouter.getRouter());
}

// need to remove all conflicts before we can remove the node group links
List<ConflictNodeGroupLink> conflicts = dataLoaderService.getConflictSettingsNodeGroupLinks();
for (ConflictNodeGroupLink conflict : conflicts) {
dataLoaderService.delete(conflict);
}

// remove the links so the symmetric table trigger will be removed
Expand All @@ -552,12 +559,13 @@ public synchronized void uninstall() {

// this should remove all triggers because we have removed all the
// trigger configuration
triggerRouterService.syncTriggers();

triggerRouterService.syncTriggers();
} catch (SqlException ex) {
// these tables must not exist
//TODO: figure out what we really want to do here...
log.error("SQL Exception while trying to uninstall. " + ex.getMessage() );
}

// remove any additional triggers that may remain because they were not in trigger history
symmetricDialect.cleanupTriggers();

Expand Down

0 comments on commit 41e9a27

Please sign in to comment.