-- Application table, separate from the BATCH_* tables that BatchJdbcAutoConfiguration -- creates via spring.batch.jdbc.initialize-schema. The UNIQUE constraint on sku is what turns -- the poisoned duplicate row into a real DataIntegrityViolationException at chunk-commit time -- rather than something the processor could have caught by looking at one row in isolation. CREATE TABLE IF NOT EXISTS PRODUCT ( id BIGINT AUTO_INCREMENT PRIMARY KEY, sku VARCHAR(16) NOT NULL UNIQUE, name VARCHAR(200) NOT NULL, price_cents BIGINT NOT NULL );