#rollback whole job after exception spring batch

15 messages · Page 1 of 1 (latest)

bleak leafBOT
#

This post has been reserved for your question.

Hey @thin scroll! Please use /close or the Close Post button 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.

rapid nebula
#

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

rapid nebula
#

also for write access?

thin scroll
rapid nebula
#

I guess you can probably disable that

#

but the DB might be the issue

#

Can your DB really handle a transaction that big?

thin scroll
#

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

rapid nebula
#

What if the DB only allows e.g. 1000 updates per transaction

#

you can try but idk whether it will work