Skip to content

Commit

Permalink
fix for sql lite
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Dec 3, 2012
1 parent b987ce2 commit fe3dd8f
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -22,6 +22,7 @@
package org.jumpmind.symmetric.service.impl;

import java.sql.Timestamp;
import java.sql.Types;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
Expand Down Expand Up @@ -212,12 +213,14 @@ private int purgeByMinMax(long[] minMax, MinMaxDeleteSql identifier, Date retent

String deleteSql = null;
Object[] args = null;
int[] argTypes = null;

switch (identifier) {
case DATA:
deleteSql = getSql("deleteDataSql");
args = new Object[] { minId, maxId, cutoffTime, minId, maxId, minId, maxId,
OutgoingBatch.Status.OK.name() };
argTypes = new int[] { Types.NUMERIC, Types.NUMERIC, Types.TIMESTAMP, Types.NUMERIC, Types.NUMERIC, Types.NUMERIC, Types.NUMERIC};
break;
case DATA_EVENT:
deleteSql = getSql("deleteDataEventSql");
Expand All @@ -235,7 +238,7 @@ private int purgeByMinMax(long[] minMax, MinMaxDeleteSql identifier, Date retent
break;
}

totalCount += sqlTemplate.update(deleteSql, args);
totalCount += sqlTemplate.update(deleteSql, args, argTypes);

if (totalCount > 0
&& (System.currentTimeMillis() - ts > DateUtils.MILLIS_PER_MINUTE * 5)) {
Expand Down Expand Up @@ -384,5 +387,7 @@ public void purgeAllIncomingEventsForNode(String nodeId) {
new Object[] { nodeId });
log.info("Purged all {} incoming batch for node {}", count, nodeId);
}



}

0 comments on commit fe3dd8f

Please sign in to comment.