Selected Java Interview Questions
Mar 24, 2023 · Backend Development
Isolating Transactions in Spring Scheduled Tasks to Prevent Whole‑Loop Rollback
The article explains how to process a batch of overdue unpaid orders in a Spring scheduled task by wrapping each order's business logic in a separate REQUIRES_NEW transaction, catching exceptions, and manually rolling back only the failing transaction so that other orders remain unaffected.
JavaREQUIRES_NEWScheduled Task
0 likes · 6 min read