adamsaghy commented on code in PR #6069:
URL: https://github.com/apache/fineract/pull/6069#discussion_r3630643599
##########
fineract-cob/src/main/java/org/apache/fineract/cob/COBBusinessStepServiceImpl.java:
##########
@@ -56,6 +57,10 @@ public class COBBusinessStepServiceImpl implements
COBBusinessStepService {
@SuppressWarnings({ "unchecked" })
@Override
+ // Spring Batch 6 ChunkOrientedStep runs item processing on task-executor
threads OUTSIDE the chunk transaction,
+ // so the business step chain must open its own transaction there; in
sequential mode REQUIRED simply joins the
+ // chunk transaction, matching the Batch 5 behavior
+ @Transactional
Review Comment:
// Spring Batch 6's ChunkOrientedStep submits item processing to the step's
task executor.
// The chunk transaction is bound to the step thread and wraps only the
write phase, so in
// multi-threaded mode processItem() runs on a pool thread with NO
transaction. Business steps
// below write to the DB, so processing must run in a transaction of its
own:
// - sequential mode: REQUIRED joins the chunk transaction (as in
Batch 5);
// - concurrent mode: REQUIRED opens a NEW transaction on the worker
thread that commits
// independently of the chunk write. Chunk-level atomicity is
therefore NOT preserved when
// concurrent — process-time writes are not rolled back with the
chunk. See FINERACT-2684.
Might be more correct and we might need to figure out a way to handle this
consistently...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]