Skip to content

Commit

Permalink
Merge branch '3.8' of https://github.com/JumpMind/symmetric-ds into 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Sep 14, 2016
2 parents 183fd14 + 16cc488 commit a7704ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Expand Up @@ -40,6 +40,7 @@
import java.util.Collections;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
Expand All @@ -54,6 +55,7 @@
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.log4j.Appender;
import org.apache.log4j.FileAppender;
import org.apache.log4j.Layout;
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.jumpmind.db.model.Table;
import org.jumpmind.exception.IoException;
Expand Down Expand Up @@ -112,9 +114,9 @@ public static File createSnapshot(ISymmetricEngine engine) {
logDir = new File("logs");

if (!logDir.exists()) {
File file = findSymmetricLogFile();
if (file != null) {
logDir = file.getParentFile();
Map<File, Layout> matches = findSymmetricLogFile();
if (matches != null && matches.size() == 1) {
logDir = matches.keySet().iterator().next().getParentFile();
}
}

Expand Down Expand Up @@ -579,7 +581,7 @@ protected static String getLastFinishTime(IJob job, Lock lock) {
}

@SuppressWarnings("unchecked")
public static File findSymmetricLogFile() {
public static Map<File, Layout> findSymmetricLogFile() {
Enumeration<Appender> appenders = org.apache.log4j.Logger.getRootLogger().getAllAppenders();
while (appenders.hasMoreElements()) {
Appender appender = appenders.nextElement();
Expand All @@ -588,7 +590,9 @@ public static File findSymmetricLogFile() {
if (fileAppender != null) {
File file = new File(fileAppender.getFile());
if (file != null && file.exists()) {
return file;
Map<File, Layout> matches = new HashMap<File, Layout>();
matches.put(file, fileAppender.getLayout());
return matches;
}
}
}
Expand Down
Expand Up @@ -37,7 +37,7 @@ public SqliteTriggerTemplate(AbstractSymmetricDialect symmetricDialect) {

String sourceNodeExpression;
if(isBlank(sqliteFunctionToOverride)){
sourceNodeExpression = "(select value from $(prefixName)_context where name = 'sync_node_disabled')";
sourceNodeExpression = "(select context_value from $(prefixName)_context where name = 'sync_node_disabled')";
}else{
sourceNodeExpression = "(select substr(" + sqliteFunctionToOverride + "(), 10) from sqlite_master where " + sqliteFunctionToOverride + "() like 'DISABLED:%')";
}
Expand Down

0 comments on commit a7704ba

Please sign in to comment.