Skip to content

Commit

Permalink
peek ahead logic always evaluated to true because the transactionIds …
Browse files Browse the repository at this point in the history
…were always being add to the compare to list prior to the compare to. Also fixed database timing stats for outgoing_batch_hist.
  • Loading branch information
chenson42 committed Apr 23, 2008
1 parent 12d4374 commit 230c9a2
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,15 @@ public Object doInConnection(Connection conn) throws SQLException, DataAccessExc

do {
String trxId = results.getString(1);
if (trxId != null) {
transactionIds.add(trxId);
}

if (!peekAheadMode
|| (peekAheadMode && (trxId != null && transactionIds
.contains(trxId)))) {
peekAheadCountDown = batchSizePeekAhead;

if (trxId != null) {
transactionIds.add(trxId);
}

int dataId = results.getInt(2);

Expand Down Expand Up @@ -167,7 +168,11 @@ public Object doInConnection(Connection conn) throws SQLException, DataAccessExc
}

} while (results.next() && peekAheadCountDown != 0);


long startTime = System.currentTimeMillis();
update.executeBatch();
databaseMillis += (System.currentTimeMillis() - startTime);

history.setEndTime(new Date());
history.setDataEventCount(dataEventCount);
history.setDatabaseMillis(databaseMillis);
Expand All @@ -180,7 +185,7 @@ public Object doInConnection(Connection conn) throws SQLException, DataAccessExc
JdbcUtils.closeStatement(select);
}

update.executeBatch();

}
} finally {
JdbcUtils.closeStatement(update);
Expand Down

0 comments on commit 230c9a2

Please sign in to comment.