Navigation Menu

Skip to content

Commit

Permalink
Better error handling in backward compatibility code.
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Sep 3, 2010
1 parent ebaebd9 commit f3ff97b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Expand Up @@ -31,6 +31,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeSet;

import org.apache.commons.lang.StringUtils;
import org.jumpmind.symmetric.Version;
Expand Down Expand Up @@ -148,12 +149,23 @@ protected List<TriggerHistory> getActiveTriggerHistoriesForInactivation() {
}
return hists;
}

private String getNewestVersionOfRootConfigChannelTableNames() {
TreeSet<String> ordered = new TreeSet<String>(rootConfigChannelTableNames.keySet());
return ordered.last();
}

public List<TriggerRouter> getTriggerRoutersForRegistration(String version,
String sourceGroupId, String targetGroupId) {
int initialLoadOrder = 1;
String majorVersion = Integer.toString(Version.parseVersion(version)[0]);
String majorVersion = Integer.toString(Version.parseVersion(version)[0]);
List<String> tables = rootConfigChannelTableNames.get(majorVersion);
if (tables == null) {
String newestVersion = getNewestVersionOfRootConfigChannelTableNames();
log.warn("TriggersDefaultVersionWarning", newestVersion, majorVersion);
majorVersion = newestVersion;
tables = rootConfigChannelTableNames.get(majorVersion);
}
List<TriggerRouter> triggers = new ArrayList<TriggerRouter>(tables.size());
for (int j = 0; j < tables.size(); j++) {
String tableName = tables.get(j);
Expand Down
Expand Up @@ -277,6 +277,7 @@ TriggerSynchronizingFailed=Failed to synchronize trigger for %s
TriggersSynchronizing=Synchronizing triggers
TriggersSynchronizingFailedLock=Did not run the syncTriggers process because the cluster service has it locked
TriggersSynchronized=Done synchronizing triggers
TriggersDefaultVersionWarning=Defaulting to major version %s because %s version was not valid while retrieving trigger configuration tables.
UpgradeWarning=The version of SymmetricDS incremented and %s is set to false. Please check to see if you need to update database schemas.
UnregisteredNodeStarting=Starting unregistered node [group=%s, externalId=%s]
URLConnectingFailure=Could not connect to the %s node's transport because of a bad URL: %s
Expand Down
@@ -1 +1 @@
version=2.0
version=2.1

0 comments on commit f3ff97b

Please sign in to comment.