#rollback whole job after exception spring batch
15 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @thin scroll! Please use
/closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
In principle yes but idk whether your DB can handle it with normal DB transactions
Does the DB need to be available during the import?
Note: If you are using @Transaction, it will by default only roll back on unchecked exceptions
yes
also for write access?
i dont, spring batch have transactionals in chunks
I guess you can probably disable that
but the DB might be the issue
Can your DB really handle a transaction that big?
i have no idea, but cant i have just transactional and do batches like this?
jdbcTemplate.batchUpdate(sql, items, 2000, (PreparedStatement ps, String[] argument) -> {
ps.setString(1, argument[0]);
ps.setString(2, argument[1]);
ps.setString(3, argument[2]);
});
is that really matter, how much i will have rows in one transaction?
in this situation im gonna have 10_000 batches like this