<!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd">
flushBeforeQuery = true
statement.batchSize = 1000
DELETE FROM TABLE;
<!-- do an empty query on dest_db here to flush previous statement and prevent key conflicts -->
SELECT COL1, COL2
INSERT INTO TABLE( COL1, COL2 )
VALUES( ?COL1, ?COL2 )
Pros: Less changes
Cons: Less flexible, but I still do not see an ideal solution without major changes.
I've added the explicit parameter to control flushing when a query is put into another query. This scenario is unlikely, but personally I'd prefer to have a chance of unflushed connection rather than performance degradation, but this is just my 2c:
select * from src
select * from dest
insert into t2
Probably enabling flushing, when batching is enabled is a reasonable default...
JDBC: Add support for queries in batch-mode
Added flushBeforeQuery parameter. If enabled, connection's pending batches will be flushed before executing a query.