Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Retry transaction in case of deadlock [BATCH-2452] #1150
I have multiple threads that concurrently launch jobs using a shared synchronous job launcher. For some reason, I get deadlock while issuing the INSERT statements for creating the job instances. The deadlock occurs even with a single INSERT per transaction because of the unique constraint defined on the JOB_INSTANCE table (on job name and job key). Ideally, I would like to avoid such deadlocks but I didn't find a solution. Inserting job instances in a well defined order is not possible. Therefore, I expect Spring Batch to retry the transaction instead of directly throwing the deadlock exception. However, it doesn't seem to be the case.
No further details from BATCH-2452