Skip to content

Commit

Permalink
trying to work around a extract 'too many events to batch' issue with…
Browse files Browse the repository at this point in the history
… oracle.
  • Loading branch information
chenson42 committed Oct 5, 2007
1 parent a9b7a35 commit 581c26f
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -19,7 +19,6 @@
import org.springframework.jdbc.core.ConnectionCallback;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.support.JdbcUtils;
import org.springframework.transaction.annotation.Transactional;

public class OutgoingBatchService extends AbstractService implements
IOutgoingBatchService {
Expand All @@ -40,7 +39,6 @@ public class OutgoingBatchService extends AbstractService implements

private IOutgoingBatchHistoryService historyService;

@Transactional
public void buildOutgoingBatches(final String nodeId) {
// TODO should channels be cached?
final List<NodeChannel> channels = configurationService.getChannelsFor(
Expand Down Expand Up @@ -112,12 +110,19 @@ public Object doInConnection(Connection conn) throws SQLException,
stopOnNextTxIdChange = true;
}

// put this in so we don't build up too many
// statements to send to the server.
if (count % 10000 == 0) {
update.executeBatch();
}

lastTrxId = trxId;
} while (results.next());
historyService.created(new Integer(newBatch
.getBatchId()), count);
}

JdbcUtils.closeResultSet(results);
JdbcUtils.closeStatement(select);
}
update.executeBatch();
Expand Down

0 comments on commit 581c26f

Please sign in to comment.