diff --git a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/ManageIncomingBatchListener.java b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/ManageIncomingBatchListener.java index 0996ed1e23..3cccccb574 100644 --- a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/ManageIncomingBatchListener.java +++ b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/ManageIncomingBatchListener.java @@ -31,6 +31,7 @@ import org.jumpmind.db.model.Table; import org.jumpmind.db.sql.ISqlTemplate; import org.jumpmind.db.sql.ISqlTransaction; +import org.jumpmind.db.sql.TableNotFoundException; import org.jumpmind.db.sql.UniqueKeyException; import org.jumpmind.exception.IoException; import org.jumpmind.symmetric.ISymmetricEngine; @@ -257,7 +258,9 @@ public void batchInError(DataContext context, Throwable ex) { this.currentBatch.setSqlMessage(ExceptionUtils.getRootMessage(ex)); } - if (this.currentBatch.getSqlCode() != ErrorConstants.FK_VIOLATION_CODE || !isNewErrorForCurrentBatch) { + if (ex instanceof TableNotFoundException) { + log.error(String.format("The incoming batch %s failed: %s", this.currentBatch.getNodeBatchId(), ex.getMessage())); + } else if (this.currentBatch.getSqlCode() != ErrorConstants.FK_VIOLATION_CODE || !isNewErrorForCurrentBatch) { log.error(String.format("Failed to load batch %s", this.currentBatch.getNodeBatchId()), ex); } } diff --git a/symmetric-db/src/main/java/org/jumpmind/db/sql/TableNotFoundException.java b/symmetric-db/src/main/java/org/jumpmind/db/sql/TableNotFoundException.java new file mode 100644 index 0000000000..efa9dd2897 --- /dev/null +++ b/symmetric-db/src/main/java/org/jumpmind/db/sql/TableNotFoundException.java @@ -0,0 +1,11 @@ +package org.jumpmind.db.sql; + +public class TableNotFoundException extends SqlException { + + private static final long serialVersionUID = 1L; + + public TableNotFoundException(String columnName) { + super(columnName); + } + +} diff --git a/symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/AbstractDatabaseWriter.java b/symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/AbstractDatabaseWriter.java index 83a7669280..3b3d597335 100644 --- a/symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/AbstractDatabaseWriter.java +++ b/symmetric-io/src/main/java/org/jumpmind/symmetric/io/data/writer/AbstractDatabaseWriter.java @@ -30,6 +30,7 @@ import org.jumpmind.db.model.Column; import org.jumpmind.db.model.Table; import org.jumpmind.db.sql.SqlException; +import org.jumpmind.db.sql.TableNotFoundException; import org.jumpmind.exception.ParseException; import org.jumpmind.symmetric.io.IoConstants; import org.jumpmind.symmetric.io.data.Batch; @@ -143,7 +144,7 @@ public void write(CsvData data) { || batch.getBatchId() == IoConstants.IGNORE_TABLES_BATCH)) { String qualifiedName = sourceTable.getFullyQualifiedTableName(); if (!missingTables.contains(qualifiedName)) { - log.warn("Did not find the {} table in the target database", qualifiedName); + log.info("Did not find the {} table in the target database", qualifiedName); missingTables.add(qualifiedName); } } else { @@ -260,7 +261,7 @@ public void write(CsvData data) { if (sourceTable != null) { // If the source table was found but the target table is // still unknown throw an exception - throw new SqlException(String.format("Could not find the target table '%s'", + throw new TableNotFoundException(String.format("Could not find the target table '%s'", sourceTable.getFullyQualifiedTableName())); } else { throw new SqlException("The target table was not specified");