Using a fairly recent version of spring-batch (5.1.0)
we've had some runtime errors when two batches in separate linux
processes kick off at the same time.
The error occurs within the spring-batch
code that inserts into BATCH_JOB_INSTANCE
.
Exception in SpringApplication.run()
org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [INSERT INTO BATCH_JOB_INSTA
NCE(JOB_INSTANCE_ID, JOB_NAME, JOB_KEY, VERSION)
VALUES (?, ?, ?, ?)
]; SQL state [72000]; error code [8177]; ORA-08177: can't serialize access for this transaction
I understand this to be a problem where the data in the BATCH_JOB_INSTANCE
table is changing at the same time that spring-batch
is trying to write to it.
What I don't understand is what the user of spring-batch
is supposed to do about this. I would think that this should be a framework issue rather than a user issue.
Thanks for any enlightenment and / or pointers.
-alan
The question seems to be addressed here as well:
You can set a different isolationLevelForCreate
, recommended to be READ_COMMITTED
.