Navigation Menu

Skip to content

Commit

Permalink
0003088: The last update time on sym_incoming_batch comes from the app
Browse files Browse the repository at this point in the history
serve while the create time comes from the database
  • Loading branch information
chenson42 committed May 2, 2017
1 parent a7a354a commit fd07b1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Expand Up @@ -334,7 +334,6 @@ public int updateIncomingBatch(ISqlTransaction transaction , IncomingBatch batch
batch.setErrorFlag(false);
}
batch.setLastUpdatedHostName(clusterService.getServerId());
batch.setLastUpdatedTime(new Date());
count = transaction.prepareAndExecute(
getSql("updateIncomingBatchSql"),
new Object[] { batch.getStatus().name(), batch.isErrorFlag() ? 1 : 0,
Expand All @@ -346,13 +345,13 @@ public int updateIncomingBatch(ISqlTransaction transaction , IncomingBatch batch
batch.getMissingDeleteCount(), batch.getSkipCount(),
batch.getSqlState(), batch.getSqlCode(),
FormatUtils.abbreviateForLogging(batch.getSqlMessage()),
batch.getLastUpdatedHostName(), batch.getLastUpdatedTime(), batch.getSummary(),
batch.getLastUpdatedHostName(), batch.getSummary(),
batch.getBatchId(), batch.getNodeId() }, new int[] { Types.CHAR,
Types.SMALLINT, Types.NUMERIC, Types.NUMERIC, Types.NUMERIC,
Types.NUMERIC, Types.NUMERIC, Types.NUMERIC, Types.NUMERIC,
Types.NUMERIC, Types.NUMERIC, Types.NUMERIC, Types.NUMERIC,
Types.NUMERIC, Types.NUMERIC, Types.VARCHAR, Types.NUMERIC, Types.VARCHAR,
Types.VARCHAR, Types.TIMESTAMP, Types.VARCHAR, symmetricDialect.getSqlTypeForIds(), Types.VARCHAR });
Types.VARCHAR, Types.VARCHAR, symmetricDialect.getSqlTypeForIds(), Types.VARCHAR });
}
return count;
}
Expand Down Expand Up @@ -396,7 +395,7 @@ public List<IncomingBatchSummary> findIncomingBatchSummary(Status... statuses) {
public Map<String, Date> findLastUpdatedByChannel() {
Map<String, Date> captureMap = new HashMap<String, Date>();
LastCaptureByChannelMapper mapper = new LastCaptureByChannelMapper(captureMap);
List<String> temp = sqlTemplate.query(getSql("lastUpdateByChannelSql"), mapper);
sqlTemplate.query(getSql("lastUpdateByChannelSql"), mapper);
return mapper.getCaptureMap();
}

Expand Down
Expand Up @@ -67,7 +67,7 @@ public IncomingBatchServiceSqlMap(IDatabasePlatform platform, Map<String, String
putSql("updateIncomingBatchSql" ,"" +
"update $(incoming_batch) set status = ?, error_flag=?, network_millis = ?, filter_millis = ?, database_millis = ?, failed_row_number = ?, failed_line_number = ?, byte_count = ?, " +
" statement_count = ?, fallback_insert_count = ?, fallback_update_count = ?, ignore_count = ?, ignore_row_count = ?, missing_delete_count = ?, skip_count = ?, sql_state = ?, sql_code = ?, sql_message = ?, " +
" last_update_hostname = ?, last_update_time = ?, summary = ? where batch_id = ? and node_id = ? " );
" last_update_hostname = ?, last_update_time = current_timestamp, summary = ? where batch_id = ? and node_id = ? " );

putSql("deleteIncomingBatchSql" ,"" +
"delete from $(incoming_batch) where batch_id = ? and node_id = ? " );
Expand Down

0 comments on commit fd07b1c

Please sign in to comment.