Skip to content

Commit

Permalink
SYMMETRICDS-558 - Don't peek ahead and order by transaction id if the…
Browse files Browse the repository at this point in the history
… channel is set to nontransactional
  • Loading branch information
chenson42 committed Nov 28, 2011
1 parent fe97e0c commit ec1e9db
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -143,16 +143,18 @@ public Integer doInConnection(Connection c) throws SQLException, DataAccessExcep
int peekAheadCount = dbDialect.getRouterDataPeekAheadCount();
String lastTransactionId = null;
List<Data> peekAheadQueue = new ArrayList<Data>(peekAheadCount);

boolean nontransactional = context.getChannel().getBatchAlgorithm().equals("nontransactional");

ps = prepareStatment(c);
rs = executeQuery(ps);


boolean moreData = true;
while (dataCount <= maxDataToRoute || lastTransactionId != null) {
if (moreData) {
moreData = fillPeekAheadQueue(peekAheadQueue, peekAheadCount, rs);
}
if (lastTransactionId == null && peekAheadQueue.size() > 0) {
if ((lastTransactionId == null || nontransactional) && peekAheadQueue.size() > 0) {
Data data = peekAheadQueue.remove(0);
copyToQueue(data);
dataCount++;
Expand Down

0 comments on commit ec1e9db

Please sign in to comment.